reflect change in how ls -H works
authorJim Meyering <jim@meyering.net>
Sat, 18 Jan 2003 18:06:38 +0000 (18:06 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 18 Jan 2003 18:06:38 +0000 (18:06 +0000)
tests/ls/dangle
tests/ls/inode

index 1c9a55a..b08d245 100755 (executable)
@@ -27,10 +27,10 @@ fail=0
 
 # This must exit nonzero.
 ls -L dangle > /dev/null 2>&1 && fail=1
+# So must this.
+ls -H dangle > /dev/null 2>&1 && fail=1
 
 # This must exit successfully.
-ls -H dangle > out 2>&1 || fail=1
-# So must this.
 ls dangle >> out || fail=1
 
 ls slink-to-dir >> out 2>&1 || fail=1
@@ -39,7 +39,6 @@ ls -L slink-to-dir >> out 2>&1 || fail=1
 
 cat <<\EOF > exp
 dangle
-dangle
 sub
 sub
 sub
index f4bf384..934f7cf 100755 (executable)
@@ -27,7 +27,7 @@ fail=0
 set x `ls -Ci f slink`; shift
 test $# = 4 || fail=1
 # The inode numbers should differ.
-test "$1" = "$3" && fail=1
+test "$1" != "$3" || fail=1
 
 set x `ls -CLi f slink`; shift
 test $# = 4 || fail=1
@@ -36,7 +36,12 @@ test "$1" = "$3" || fail=1
 
 set x `ls -CHi f slink`; shift
 test $# = 4 || fail=1
-# With -H, they must differ.
-test "$1" = "$3" && fail=1
+# With -H, they must be the same, too.
+# Note that POSIX says -H must make ls dereference only
+# symlinks (specified on the command line) to directories,
+# but the historical BSD meaning of -H is to dereference
+# any symlink given on the command line.  For compatibility GNU ls
+# implements the BSD semantics.
+test "$1" = "$3" || fail=1
 
 (exit $fail); exit $fail