On 20 May 2016 at 17:57, Ingo Feinerer <[email protected]> wrote:
> The problem appears to be in make_openout_test () with
>
> eval "$tex_cmd" >/dev/null 2>&1
>
> When changing this line to
>
> echo before eval
> echo "$tex_cmd"
> eval "$tex_cmd" >/dev/null 2>&1
> echo after eval
>
> we have
>
> $ ./texi2dvi test1.tex
> before eval
> latex --file-line-error </dev/null '
> onstopmode' '\input' ./openout.tex
>
> (The newline before onstopmode is there and was not introduced by
> accident when pasting into this mail.)

The newline is not actually present in the variable's value: the
sequence "\n" (two characters) is being interpreted as a newline by
the "echo" command. You can tell this because of this:

> ! Emergency stop.
> <*> \nonstopmode \input ./openout.tex

I believe the following is the correct fix:

Index: texi2dvi
===================================================================
--- texi2dvi    (revision 7149)
+++ texi2dvi    (working copy)
@@ -1494,7 +1494,11 @@
     # ./ in case . isn't in path
     verbose "$0: running $tex_cmd ..."
     rm -fr "openout.$2"
-    eval "$tex_cmd" >/dev/null 2>&1
+    if eval "$tex_cmd" >/dev/null 2>&1; then
+      return 0 # success
+    else
+      return 1 # failure
+    fi
 }

 # Check tex supports -recorder option


For some reason with many shells other than the one you're using, the
"set -e" doesn't apply here because it's run within an "if" condition,
but I don't think we should rely on that.

Reply via email to