1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

Merge pull request #5020 from indygreg/hashsum-file-stem

hashsum: use file_stem() instead of file_name()
This commit is contained in:
Daniel Hofstetter 2023-06-29 13:50:30 +02:00 committed by GitHub
commit 610e0461e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -306,7 +306,7 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> {
// if there is no program name for some reason, default to "hashsum" // if there is no program name for some reason, default to "hashsum"
let program = args.next().unwrap_or_else(|| OsString::from(NAME)); let program = args.next().unwrap_or_else(|| OsString::from(NAME));
let binary_name = Path::new(&program) let binary_name = Path::new(&program)
.file_name() .file_stem()
.unwrap_or_else(|| OsStr::new(NAME)) .unwrap_or_else(|| OsStr::new(NAME))
.to_string_lossy(); .to_string_lossy();