]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: ls/stat-vs-dirent: avoid spurious test failure
authorJim Meyering <meyering@redhat.com>
Sat, 5 Sep 2009 17:06:31 +0000 (19:06 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 5 Sep 2009 17:06:31 +0000 (19:06 +0200)
* tests/ls/stat-vs-dirent: Avoid test failure when run from a
directory whose name (or ancestor directory name) starts with ".".

tests/ls/stat-vs-dirent

index 064ec12aeecf9206c725511ab15ae976db7e407c..9f2b14925ce6e4d4084611f42e324f096ea6c486 100755 (executable)
@@ -43,7 +43,10 @@ while :; do
     # Make sure that they are the same.
     # We know from experience that there may be mismatches on some
     # buggy file systems, at mount points.
-    if test "$d_ino" != "$st_ino"; then
+    # Note that when a directory contains only entries whose names
+    # start with ".", d_ino and file will both be empty.  In that case,
+    # skip the test.
+    if test -n "$d_ino" && test "$d_ino" != "$st_ino"; then
       echo "$0: test failed: $t/$file: d_ino($d_ino) != st_ino($st_ino)
         This may indicate a flaw in your kernel or file system implementation.
         The flaw isn't serious for coreutils, but it might break other tools,