$OpenBSD: patch-src_output_c,v 1.4 2008/07/08 00:24:17 brad Exp $ --- src/output.c.orig Sun May 14 16:40:35 2006 +++ src/output.c Sun Jun 29 22:15:11 2008 @@ -501,7 +501,8 @@ output_skeleton (void) FILE *in; FILE *out; int filter_fd[2]; - char const *argv[6]; + char const *argv[7]; + int i; pid_t pid; /* Compute the names of the package data dir and skeleton file. @@ -512,7 +513,7 @@ output_skeleton (void) char *full_m4sugar; char *full_skeleton; char const *p; - char const *m4 = (p = getenv ("M4")) ? p : M4; + char const *m4 = (p = getenv ("M4")) ? p : "/usr/bin/m4"; char const *pkgdatadir = (p = getenv ("BISON_PKGDATADIR")) ? p : PKGDATADIR; size_t skeleton_size = strlen (skeleton) + 1; size_t pkgdatadirlen = strlen (pkgdatadir); @@ -534,12 +535,16 @@ output_skeleton (void) fprintf (stderr, "running: %s %s - %s\n", m4, full_m4sugar, full_skeleton); - argv[0] = m4; - argv[1] = full_m4sugar; - argv[2] = "-"; - argv[3] = full_skeleton; - argv[4] = trace_flag & trace_m4 ? "-dV" : NULL; - argv[5] = NULL; + i = 0; + argv[i++] = m4; + if (strcmp(m4, "/usr/bin/m4") == 0) { + argv[i++] = "-g"; + } + argv[i++] = full_m4sugar; + argv[i++] = "-"; + argv[i++] = full_skeleton; + argv[i++] = trace_flag & trace_m4 ? "-dV" : NULL; + argv[i++] = NULL; init_subpipe (); pid = create_subpipe (argv, filter_fd);