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 @@ int main (int argc, char *argv[]) { + { + char *cp = getenv ("BISON_PROGRAM_NAME"); + if (cp) + argv[0] = cp; + } + #define DEPENDS_ON_LIBINTL 1 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@' BISON_PKGDATADIR=$abs_top_srcdir/data export BISON_PKGDATADIR -stderr=tmp-bison.$$ - -# 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 -fi - -# 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" -status=$? - # 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" +BISON_PROGRAM_NAME=bison +export BISON_PROGRAM_NAME + +$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} +status=$? # 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