Skip to content

Commit

Permalink
add support for filenames with dots in them
Browse files Browse the repository at this point in the history
  • Loading branch information
vladh committed Feb 24, 2023
1 parent 8ca2330 commit b830623
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/output_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ pub fn get_outname(
.map(|s| sanitize(s))
.filter(|s| !s.is_empty())
.unwrap_or_else(|| "dezoomified".into());
let mut path = base_dir.join(base).with_extension(extension);
let mut path = base_dir.to_path_buf();
let mut base_with_ext = OsString::from(&base);
base_with_ext.push(".");
base_with_ext.push(&extension);
path = path.join(base_with_ext);

// append a suffix (_1,_2,..) to `outname` if the file already exists
let filename = path.file_stem().map(OsString::from).unwrap_or_default();
Expand Down

0 comments on commit b830623

Please sign in to comment.