depcomp: be more idiomatic in checking for zero exit statuses
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 18 Oct 2012 10:47:17 +0000 (12:47 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 24 Nov 2012 14:52:40 +0000 (15:52 +0100)
* lib/depcomp: Prefer "if test $stat -ne 0; then ..." over the longer
"if test $stat -eq 0; then :; else ...".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/depcomp

index e1f51f4..dfc97de 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2012-07-12.20; # UTC
+scriptversion=2012-10-18.11; # UTC
 
 # Copyright (C) 1999-2012 Free Software Foundation, Inc.
 
@@ -136,8 +136,7 @@ gcc3)
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -163,8 +162,7 @@ gcc)
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -206,8 +204,7 @@ sgi)
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -269,8 +266,7 @@ aix)
   fi
   stat=$?
 
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -317,8 +313,7 @@ icc)
   # with horizontal tabulation characters.
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -434,8 +429,7 @@ hp2)
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -497,8 +491,7 @@ tru64)
    fi
 
    stat=$?
-   if test $stat -eq 0; then :
-   else
+   if test $stat -ne 0; then
       rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
       exit $stat
    fi
@@ -525,8 +518,7 @@ msvc7)
   "$@" $showIncludes > "$tmpdepfile"
   stat=$?
   grep -v '^Note: including file: ' "$tmpdepfile"
-  if test "$stat" = 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi