[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison 3.7.90 (beta): test 4

From: Akim Demaille
Subject: Re: Bison 3.7.90 (beta): test 4
Date: Sun, 29 Aug 2021 10:08:40 +0200

Hi Dagobert,

> Le 23 août 2021 à 15:12, Dagobert Michelsen <dam@opencsw.org> a écrit :
> Hi Akim,
> sorry for the delay, got distracted!

No problem.  I was unavailable for a while :)

> Am 20.08.2021 um 09:01 schrieb Akim Demaille <akim@lrde.epita.fr>:
>> Wow...  So that would be a problem with sed?
>> sed -e 's/foo/bar/g' <input.y >dir/sed.1.log
>> LC_ALL=C sed -e 's/foo/bar/g' <input.y >dir/sed.2.log

So it is indeed a problem with sed: neither sed.1.log nor sed.2.log have the 
expected NUL byte.

So I'm installing the patch below.  Could you please check this tarball:



commit bc5aa8e2743e7b56818d54719bf4095a6dc09912
Author: Akim Demaille <akim.demaille@gmail.com>
Date:   Sun Aug 29 09:38:07 2021 +0200

    tests: don't postprocess stderr with sed
    On Solaris, sed throws away the NUL bytes from the stream, even in C
    locale.  So instead of postprocessing bison's stderr to neutralize
    changes in value of `argv[0]`, use an envvar to actually neutralize
    variations of `argv[0]` during tests.
    Reported by Dagobert Michelsen.
    * src/main.c (main): Change `argv[0]` if BISON_PROGRAM_NAME is
    * tests/bison.in: No longer mess with stderr, just pass
    the expected BISON_PROGRAM_NAME value.

diff --git a/src/main.c b/src/main.c
index 22291d23..1185bf24 100644
--- a/src/main.c
+++ b/src/main.c
@@ -63,6 +63,12 @@
 main (int argc, char *argv[])
+  {
+    char *cp = getenv ("BISON_PROGRAM_NAME");
+    if (cp)
+      argv[0] = cp;
+  }
   set_program_name (argv[0]);
   setlocale (LC_ALL, "");
diff --git a/tests/bison.in b/tests/bison.in
index 80003aca..7732edd4 100644
--- a/tests/bison.in
+++ b/tests/bison.in
@@ -25,27 +25,13 @@ abs_top_builddir='@abs_top_builddir@'
-# If stderr is a tty, force --color=yes to simulate --color=auto
-# although we save and modify stderr.
-if test -t 2; then
-    set x --color=yes ${1+"$@"}
-    shift
-# We redirect stderr, which breaks the computation of the terminal
-# screen width.  So export COLUMNS to Bison, hoping for the shell to
-# have defined it.
-: ${COLUMNS=`(tput cols) 2>/dev/null || echo 132`}
-export COLUMNS
-$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} 2>"$stderr"
 # Neutralize path differences in error messages so that check and
 # installcheck behave the same way.
-sed -e "s,$abs_top_builddir/src/,,g" <"$stderr" >&2
-rm -f "$stderr"
+$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"}
 # As a special dark magic, if we are actually using this wrapper to
 # compile Bison's src/parse-gram.y, post-process the synclines to

reply via email to

[Prev in Thread] Current Thread [Next in Thread]