openbsd-ports/devel/bison/patches/patch-src_output_c
2005-11-21 09:15:11 +00:00

46 lines
1.3 KiB
Plaintext

$OpenBSD: patch-src_output_c,v 1.3 2005/11/21 09:15:11 espie Exp $
--- src/output.c.orig Sat Nov 19 16:01:00 2005
+++ src/output.c Sat Nov 19 16:04:17 2005
@@ -506,7 +506,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.
@@ -518,7 +519,7 @@ output_skeleton (void)
char *full_cm4;
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);
@@ -542,12 +543,16 @@ output_skeleton (void)
fprintf (stderr, "running: %s %s - %s %s\n",
m4, full_m4sugar, full_cm4, full_skeleton);
- argv[0] = m4;
- argv[1] = full_m4sugar;
- argv[2] = "-";
- argv[3] = full_cm4;
- argv[4] = full_skeleton;
- 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_cm4;
+ argv[i++] = full_skeleton;
+ argv[i++] = NULL;
init_subpipe ();
pid = create_subpipe (argv, filter_fd);