diff --git a/src/uu/mktemp/src/mktemp.rs b/src/uu/mktemp/src/mktemp.rs index fed946577..1764b8e84 100644 --- a/src/uu/mktemp/src/mktemp.rs +++ b/src/uu/mktemp/src/mktemp.rs @@ -283,7 +283,7 @@ impl Params { .to_string(); // Check that the prefix is valid. - let prefix_of_template = Path::new(prefix_from_template).display().to_string(); + let prefix_of_template = Path::new(prefix_from_template).to_string_lossy(); if options.treat_as_template && prefix_of_template.contains(MAIN_SEPARATOR) { return Err(MkTempError::PrefixContainsDirSeparator(options.template));