diff --git a/src/main.rs b/src/main.rs index d81202e..a4d41bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -197,10 +197,12 @@ fn main() -> std::io::Result<()> { .nth(1) .unwrap_or("") .trim_end_matches('\"') - .replace([' ', '/'], "_"); // This is to handle the "tests/itest" in ARGS + .replace([' ', '/'], "_") // This is to handle the "tests/itest" in ARGS + .replace(&['<', '>', ':', '"', '/', '\\', '|', '?', '*'][..], "_"); // Sanitize for Windows let file_path = dump_path.join(format!("ptest_{}.toml", args)); - let mut file = File::create(file_path).expect("Failed to create file"); + let mut file = + File::create(&file_path).expect(&format!("Failed to create file at {:?}", file_path)); file.write_all(content.as_bytes()) .expect("Failed to write to file"); }