summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-02-20 04:54:56 +0000
committerJim Meyering <jim@meyering.net>1997-02-20 04:54:56 +0000
commit4af2c36dfa5a29dc358b3ac192560c48a9c8a188 (patch)
tree1e4bd6a55a1fe6b4e08b243bee4727e25f2a51bd /src
parent5234813a09891a2788384edc961667c80174e290 (diff)
downloadcoreutils-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 6a96a5b9a..67e372370 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -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)
{