[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fyi: yet another LINENO bug, this time with Bash
From: |
Paul Eggert |
Subject: |
fyi: yet another LINENO bug, this time with Bash |
Date: |
Wed, 31 Oct 2001 12:15:53 -0800 (PST) |
I just installed the following patch to work around a problem that I
just discovered with Bash 2.05 and LINENO. I'll also send a bug
report to the Bash maintainers.
Perhaps my optimism about LINENO was not well-founded....
2001-10-31 Paul Eggert <address@hidden>
* lib/m4sugar/m4sh.m4 (_AS_LINENO_WORKS): Do not surround body
with {}, as that triggers a bug in Bash 2.05.
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.68
diff -p -u -r1.68 m4sh.m4
--- lib/m4sugar/m4sh.m4 2001/10/31 19:23:37 1.68
+++ lib/m4sugar/m4sh.m4 2001/10/31 20:03:06
@@ -462,14 +462,18 @@ fi
# _AS_LINENO_WORKS
# ---------------
# Succeed if the currently executing shell supports LINENO.
+# This macro does not expand to a single shell command, so be careful
+# when using it. Surrounding the body of this macro with {} would
+# cause "bash -c '_ASLINENO_WORKS'" to fail (with Bash 2.05, anyway),
+# but that bug is irrelevant to our use of LINENO.
m4_define([_AS_LINENO_WORKS],
-[{
+[
as_lineno_1=$LINENO
as_lineno_2=$LINENO
as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2"
-}])
+ test "x$as_lineno_3" = "x$as_lineno_2" dnl
+])
# _AS_LINENO_PREPARE
# ------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- fyi: yet another LINENO bug, this time with Bash,
Paul Eggert <=