(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.
This commit is contained in:
Jim Meyering
1997-02-20 04:54:56 +00:00
parent 5234813a09
commit 4af2c36dfa
+4 -1
View File
@@ -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)
{