"test" is better at testing for directories than "ls"
authorBruce Korb <bkorb@gnu.org>
Wed, 27 Dec 2000 15:46:42 +0000 (15:46 +0000)
committerBruce Korb <korbb@gcc.gnu.org>
Wed, 27 Dec 2000 15:46:42 +0000 (15:46 +0000)
From-SVN: r38499

gcc/ChangeLog
gcc/fixinc/fixincl.sh

index 4f1c1e10163d6320ff93f7d3d0a5292a8dbe637e..ae909575f00793810ea5d1e6bbcd5a83bc28f4de 100644 (file)
@@ -3,6 +3,7 @@
        * fixinc/Makefile.in: fix for ancient Bourne shell
        * fixinc/Makefile.BEOS: obsolete
        * fixinc/Makefile.DOS: obsolete
+       * fixinc/fixincl.sh(LINKS): use `test -d' rather than `ls' for testing
 
 2000-12-27  Bernd Schmidt  <bernds@redhat.com>
 
index 9a44cb8cc6815a52f75d1166f3c781c464c4563f..18b5fb24651367155429f449e27c8cc3534015ed 100755 (executable)
@@ -449,11 +449,11 @@ if $LINKS; then
   all_dirs=`find . -type l -print`
   for file in $all_dirs
   do
-    if ls -lLd $file > /dev/null
-    then :
-    else rm -f $file
-         test $VERBOSE -gt 3 && echo "  removed $file"
-         rmdir `dirname $file` > /dev/null && \
+    if test ! -d $file
+    then
+      rm -f $file
+      test $VERBOSE -gt 3 && echo "  removed $file"
+      rmdir `dirname $file` > /dev/null && \
            test $VERBOSE -gt 3 && \
            echo "  removed `dirname $file`"
     fi