GNU bug report logs -
#21052
[PATCH] tests: fix $? typo in null-byte
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Mon, 13 Jul 2015 23:12:02 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
* tests/null-byte: Don't assume $? survives an invocation of 'test'.
---
tests/null-byte | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/null-byte b/tests/null-byte
index 27be99e..2419667 100755
--- a/tests/null-byte
+++ b/tests/null-byte
@@ -39,7 +39,9 @@ for left in '' a '#' '\0'; do
printf "$pat\\n" >pat || framework_failure_
for locale in $locales; do
LC_ALL=$locale grep -f pat in
- test $? -eq 0 || test $? -eq 1 || fail_ "'$pat' caused an error"
+ status=$?
+ test $status -eq 0 || test $status -eq 1 ||
+ fail_ "'$pat' caused an error"
LC_ALL=$locale grep -a -f pat in | cmp -s - in ||
fail_ "-a '$pat' does not match '$data'"
done
--
2.1.0
This bug report was last modified 9 years and 320 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.