[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug#619786: texi2dvi: Syntax error: Bad function name when dash is /bin/
From: |
Jonathan Nieder |
Subject: |
Bug#619786: texi2dvi: Syntax error: Bad function name when dash is /bin/sh (uses "local" as function name) |
Date: |
Sat, 26 Mar 2011 19:50:52 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Package: texinfo
Version: 4.13a.dfsg.1-6
Severity: important
Forwarded: address@hidden
Justification: goal-dash; makes autogen ftbfs
Tags: upstream patch
Hi,
With dash is /bin/sh, texi2dvi doesn't seem to work:
| $ texi2dvi
| /usr/bin/texi2dvi: 144: /usr/bin/texi2dvi: Syntax error: Bad function name
| $ sed -ne 144p /usr/bin/texi2dvi
| ) || local () {
| $ dash -c 'true || local () { echo hi; }; echo continuing'; echo $?
| dash: 1: Syntax error: Bad function name
| 2
The cause: texi2dvi conditionally defines a function named "local".
What that condition is is not important for now; the trouble is that
regardless of the condition, dash errors out, considering such a
function declaration to be a syntax error.
At first I thought this was an odd corner case in application usage
that POSIX allows (such a function could never be used since the
builtin takes precedence, but it could be defined) and that dash was
in error. In fact that first part is true --- POSIX does allow this.
TC1 to the standard is intended not to allow it[1].
In any event, the usage is questionable. Patch to wrap it in "eval"
follows, so shells that implement local as a special builtin can avoid
some worry.
Thoughts?
Thanks for making some nice manuals possible.
Jonathan
[1] http://austingroupbugs.net/view.php?id=383
---
util/texi2dvi | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/util/texi2dvi b/util/texi2dvi
index 07f4da2..a64af49 100755
--- a/util/texi2dvi
+++ b/util/texi2dvi
@@ -141,11 +141,14 @@ test -n "$TEX" && test -d "$TEX" && unset TEX
}
test_local
test $foo = bar
-) || local () {
- case $1 in
- *=*) eval "$1";;
- esac
-}
+) ||
+eval '
+ local () {
+ case $1 in
+ *=*) eval "$1";;
+ esac
+ }
+'
# cd_orig
--
1.7.4.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Bug#619786: texi2dvi: Syntax error: Bad function name when dash is /bin/sh (uses "local" as function name),
Jonathan Nieder <=