GNU bug report logs - #21052
[PATCH] tests: fix $? typo in null-byte

Previous Next

Package: grep;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21052 in the body.
You can then email your comments to 21052 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#21052; Package grep. (Mon, 13 Jul 2015 23:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Mon, 13 Jul 2015 23:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-grep <at> gnu.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>
Subject: [PATCH] tests: fix $? typo in null-byte
Date: Mon, 13 Jul 2015 16:11:11 -0700
* 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





bug closed, send any further explanations to 21052 <at> debbugs.gnu.org and Paul Eggert <eggert <at> cs.ucla.edu> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Mon, 13 Jul 2015 23:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 Aug 2015 11:24:03 GMT) Full text and rfc822 format available.

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.