]> arthur.barton.de Git - bup.git/commitdiff
On MacOS X, "wc -l" returns extra whitespace.
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 7 Jan 2010 23:16:52 +0000 (18:16 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 7 Jan 2010 23:16:52 +0000 (18:16 -0500)
ie. "    0" instead of "0".

The easiest workaround is to compare as a number instead of as a string.
This seems to work correctly on both MacOS and Linux.

test-sh

diff --git a/test-sh b/test-sh
index d2583a7fd0f68be7f8d7fdf498a01a62702a5a22..f48be99c8722fac69e15ee14017f7382e9bb0695 100755 (executable)
--- a/test-sh
+++ b/test-sh
@@ -45,7 +45,7 @@ diff -u testfile2 out2c.tmp
          egrep -v 'dangling (commit|tree)' |
          tee -a /dev/stderr | 
          wc -l)
-    if [ "$n" != 0 ]; then
+    if [ "$n" -ne 0 ]; then
         echo "git fsck error."
         exit 5
     fi