Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bug: GNU and uutils dirname handles paths ending in "/." differently #8910

@onlyhavecans

Description

@onlyhavecans
  • NixOS: 25.05
  • uutils coreutils: 0.2.2

Hello! I am really excited about this project and wanted to try it out on my NixOS workstation but hit a pretty big bug with one of the tools I use. I searched around the repo and didn't spot any obvious matching reports and it seems that different behavior is a bug report.

On my system the uutils dirname command strips the last directory component when the path ends with /., which differs from GNU coreutils in a way that breaks homeshick.

This causes all of the generated symlinks they make to have incorrect relative paths. For example:

  • Expected: ~/.zshrc -> .homesick/repos/dotfiles/home/.zshrc
  • Actual: ~/.zshrc -> dos/.homesick/repos/dotfiles/home/.zshrc

Steps to Reproduce

$ dirname --version
dirname (uutils coreutils) 0.2.2
...

$ dirname /home/dos/.
/home

...

$ dirname --version
dirname (GNU coreutils) 9.7
...

$ dirname /home/dos/.
/home/dos

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions