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.
<https://lists.gnu.org/r/bug-bison/2021-08/msg00025.html>

* src/main.c (main): Change `argv[0]` if BISON_PROGRAM_NAME is
defined.
* tests/bison.in: No longer mess with stderr, just pass
the expected BISON_PROGRAM_NAME value.
This commit is contained in:
Akim Demaille
2021-08-29 09:38:07 +02:00
parent 0a82bf5c07
commit bc5aa8e274
2 changed files with 11 additions and 19 deletions

View File

@@ -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, "");