Hanif Ariffin
|
30a174e6e4
|
realpath: Error when resolved symlink is absolute and ENOENT (#3037)
* 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>
|
2022-03-03 23:06:15 +01:00 |
|
James Robson
|
625c3f2330
|
Add -e/-m to realpath
|
2021-09-05 22:50:23 +02:00 |
|
Michael Debertol
|
ea41cc0ff6
|
uucore/fs: use the latest resolution that did not fail
When we ignore failures resolving symbolic links we should keep the
latest resolution that did not fail, not the original path.
|
2021-08-24 21:18:10 +02:00 |
|
James Robson
|
0e04f959c2
|
Add Physical mode to realpath
This adds the 'Physical Mode' and 'Logical Mode' switches to realpath, which control when symlinks are resolved.
|
2021-08-01 17:06:09 +01:00 |
|
Jan Scheer
|
cc30aead22
|
realpath: refactor tests for #1982
|
2021-04-05 23:55:02 +02:00 |
|
Sylvestre Ledru
|
992c113f09
|
Remove some old code
|
2021-01-22 09:40:38 +01:00 |
|
Sylvestre Ledru
|
18370f39b8
|
Remove some warnings
|
2021-01-22 09:40:38 +01:00 |
|
Sylvestre Ledru
|
b8d0467da8
|
test(realpath): improve the coverage
|
2021-01-19 20:56:27 +01:00 |
|
Roy Ivy III
|
de0375f909
|
tests ~ reorganize tests
|
2020-06-01 18:30:04 -05:00 |
|