fixed error when dir is .

This commit is contained in:
guilleag01
2025-02-18 22:28:53 +01:00
parent b4f683a812
commit f1fc5d3c60
2 changed files with 5 additions and 1 deletions

View File

@@ -41,7 +41,10 @@ impl Compiler {
let mut o_s: Vec<String> = Vec::new(); let mut o_s: Vec<String> = Vec::new();
for file in self.needed_src.clone() { for file in self.needed_src.clone() {
let o_file = format!("{}.o", file.split(".").collect::<Vec<&str>>()[0]); let o_file = format!(
"{}.o",
path::Path::new(&file).with_extension("").to_str().unwrap()
);
let o_path = path::Path::new(&o_file); let o_path = path::Path::new(&o_file);
let mut o_comp = o_path.components(); let mut o_comp = o_path.components();
o_comp.next(); o_comp.next();
@@ -159,6 +162,7 @@ impl Compiler {
.unwrap() .unwrap()
.to_string(), .to_string(),
); );
(src_file, header_files) (src_file, header_files)
} }

BIN
test/main

Binary file not shown.