diff options
author | Jim Meyering <jim@meyering.net> | 1997-02-20 04:54:56 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-02-20 04:54:56 +0000 |
commit | 4af2c36dfa5a29dc358b3ac192560c48a9c8a188 (patch) | |
tree | 1e4bd6a55a1fe6b4e08b243bee4727e25f2a51bd /src | |
parent | 5234813a09891a2788384edc961667c80174e290 (diff) | |
download | coreutils-4af2c36dfa5a29dc358b3ac192560c48a9c8a188.tar.xz |
(main): Remove trailing slashes from command line arguments.
Otherwise, running `mkdir x; chmod 644 x; ls -d x/' (note the trailing
slash) makes ls fail with permission denied on at least Linux 1.2.13
and 2.0.14 systems.
Diffstat (limited to 'src')
-rw-r--r-- | src/ls.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -698,7 +698,10 @@ main (int argc, char **argv) if (i < argc) dir_defaulted = 0; for (; i < argc; i++) - gobble_file (argv[i], 1, ""); + { + strip_trailing_slashes (argv[i]); + gobble_file (argv[i], 1, ""); + } if (dir_defaulted) { |