]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
skip directories, too.
authorJim Meyering <jim@meyering.net>
Sat, 20 Jul 2002 05:36:59 +0000 (05:36 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 20 Jul 2002 05:36:59 +0000 (05:36 +0000)
Otherwise, we'd have to account for the additional `directory ' part
of a diagnostic like this:

fail-eperm: unexpected dignostic from `rm -f /tmp/.pcmcia';
  got      rm: cannot remove directory `/tmp/.pcmcia': Is a directory
  expected rm: cannot remove `/tmp/.pcmcia': ...

tests/rm/fail-eperm

index fd9c7e157f9aa7fc546e0a6c759aff5b979501a2..a5eb4c18a4ae5bf2760eccac3882826812e61a52 100755 (executable)
@@ -52,9 +52,9 @@ foreach my $dir (@dir_list)
 
        foreach my $f (readdir DIR_HANDLE)
          {
-           # Skip files owned by self, and symlinks.
+           # Skip files owned by self, symlinks, and directories.
            # It's not technically necessary to skip symlinks, but it's simpler.
-           -l $f || -o _
+           -l $f || -o _ || -d _
              and next;
 
            $found_file = 1;