mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 07:12:44 +00:00
30a174e6e4
* realpath: Match behavior where resolving symlinks with absolute path is an error if ENOENT This PR changes `realpath` to match the behavior in GNU where, ```shell hbina@akarin ~/Documents> mkdir dir1 hbina@akarin ~/Documents> mkdir dir2 hbina@akarin ~/Documents> touch dir2/bar hbina@akarin ~/Documents> ln -s ../dir2/bar dir1/foo1 hbina@akarin ~/Documents> ln -s /dir2/bar dir1/foo2 hbina@akarin ~/Documents> ln -s ../dir2/baz dir1/foo3 hbina@akarin ~/Documents> realpath ./dir1/foo1 ./dir1/foo2 ./dir1/foo3 /home/hbina/Documents/dir2/bar realpath: ./dir1/foo2: No such file or directory /home/hbina/Documents/dir2/baz ``` Currently, our `realpath` will happily print the second one out, ```shell hbina@akarin ~/Documents> ~/git/uutils/target/debug/coreutils realpath ./dir1/foo1 ./dir1/foo2 ./dir1/foo3 /home/hbina/Documents/dir2/bar /dir2/bar /home/hbina/Documents/dir2/baz ``` Closes https://github.com/uutils/coreutils/issues/3036 Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com> |
||
---|---|---|
.. | ||
macros.rs | ||
mod.rs | ||
util.rs |