ls: make -i compatible with coreutils: don't follow symlink by default
Signed-off-by: Martijn Dekker <martijn@inlv.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
46fc3290c2
commit
f83292cfc4
@ -1204,8 +1204,8 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
nfiles = 0;
|
nfiles = 0;
|
||||||
do {
|
do {
|
||||||
cur = my_stat(*argv, *argv,
|
cur = my_stat(*argv, *argv,
|
||||||
/* follow links on command line unless -l, -s or -F: */
|
/* follow links on command line unless -l, -i, -s or -F: */
|
||||||
!(option_mask32 & (OPT_l|OPT_s|OPT_F))
|
!(option_mask32 & (OPT_l|OPT_i|OPT_s|OPT_F))
|
||||||
/* ... or if -H: */
|
/* ... or if -H: */
|
||||||
|| (option_mask32 & OPT_H)
|
|| (option_mask32 & OPT_H)
|
||||||
/* ... or if -L, but my_stat always follows links if -L */
|
/* ... or if -L, but my_stat always follows links if -L */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user