summaryrefslogtreecommitdiff
path: root/tests/null-byte
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-07-13 16:10:00 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-07-13 16:10:48 -0700
commit6c55dd4f7f86825b1e2d6164f503e290660376f2 (patch)
tree0c8a575416d91c2578fa75307e7c650ea7d89824 /tests/null-byte
parent5dffb9cbf9223c5cd923f5c0da9583db95b9e8d0 (diff)
downloadgrep-6c55dd4f7f86825b1e2d6164f503e290660376f2.tar.gz
tests: fix $? typo in null-byte
* tests/null-byte: Don't assume $? survives an invocation of 'test'.
Diffstat (limited to 'tests/null-byte')
-rwxr-xr-xtests/null-byte4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/null-byte b/tests/null-byte
index 27be99e7..24196677 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