ls: make -i compatible with coreutils: don't follow symlink by default
authorMartijn Dekker <martijn@inlv.org>
Fri, 4 Jan 2019 17:54:52 +0000 (18:54 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 4 Jan 2019 17:55:53 +0000 (18:55 +0100)
Signed-off-by: Martijn Dekker <martijn@inlv.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/ls.c

index db3ddb9446d521d7df6b2f4dd19da6de63a59166..b2adb0c06ca611a5025d2ef174c7aa9e0508c1fb 100644 (file)
@@ -1204,8 +1204,8 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
        nfiles = 0;
        do {
                cur = my_stat(*argv, *argv,
-                       /* follow links on command line unless -l, -s or -F: */
-                       !(option_mask32 & (OPT_l|OPT_s|OPT_F))
+                       /* follow links on command line unless -l, -i, -s or -F: */
+                       !(option_mask32 & (OPT_l|OPT_i|OPT_s|OPT_F))
                        /* ... or if -H: */
                        || (option_mask32 & OPT_H)
                        /* ... or if -L, but my_stat always follows links if -L */