[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patch for "c.m4 is in my working directory" bug
From: |
Paul Eggert |
Subject: |
patch for "c.m4 is in my working directory" bug |
Date: |
Thu, 26 Dec 2002 00:33:42 -0800 (PST) |
If I run "cp /dev/null c.m4", Bison stops working.
I installed the following patch.
2002-12-26 Paul Eggert <address@hidden>
Don't use m4_include on relative file names, as it doesn't work as
desired if there happens to be a file with that name under ".".
* m4sugar/version.m4: Remove; it was included but it wasn't used.
* data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
* data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
* data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
* src/output.c (output_skeleton): Use full path names when
specifying a file to include; don't rely on include path, as
it's unreliable when the working file contains a file with
that name.
Index: data/Makefile.am
===================================================================
RCS file: /cvsroot/bison/bison/data/Makefile.am,v
retrieving revision 1.7
diff -p -u -r1.7 Makefile.am
--- data/Makefile.am 22 Oct 2002 11:32:38 -0000 1.7
+++ data/Makefile.am 26 Dec 2002 08:20:26 -0000
@@ -18,4 +18,4 @@
dist_pkgdata_DATA = README c.m4 yacc.c lalr1.cc glr.c
m4sugardir = $(pkgdatadir)/m4sugar
-dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/version.m4
+dist_m4sugar_DATA = m4sugar/m4sugar.m4
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.46
diff -p -u -r1.46 glr.c
--- data/glr.c 26 Dec 2002 06:58:35 -0000 1.46
+++ data/glr.c 26 Dec 2002 08:20:26 -0000
@@ -1,5 +1,4 @@
m4_divert(-1) -*- C -*-
-m4_include([c.m4])
# GLR skeleton for Bison
# Copyright (C) 2002 Free Software Foundation, Inc.
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.17
diff -p -u -r1.17 lalr1.cc
--- data/lalr1.cc 9 Dec 2002 04:48:38 -0000 1.17
+++ data/lalr1.cc 26 Dec 2002 08:20:26 -0000
@@ -17,8 +17,6 @@ m4_divert(-1)
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA
-m4_include([c.m4])
-
## ---------------- ##
## Default values. ##
## ---------------- ##
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.45
diff -p -u -r1.45 yacc.c
--- data/yacc.c 24 Dec 2002 07:41:47 -0000 1.45
+++ data/yacc.c 26 Dec 2002 08:20:27 -0000
@@ -1,5 +1,4 @@
m4_divert(-1) -*- C -*-
-m4_include([c.m4])
# Yacc compatible skeleton for Bison
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002
Index: data/m4sugar/m4sugar.m4
===================================================================
RCS file: /cvsroot/bison/bison/data/m4sugar/m4sugar.m4,v
retrieving revision 1.4
diff -p -u -r1.4 m4sugar.m4
--- data/m4sugar/m4sugar.m4 17 Jun 2002 08:43:11 -0000 1.4
+++ data/m4sugar/m4sugar.m4 26 Dec 2002 08:20:27 -0000
@@ -1746,15 +1746,6 @@ m4_define([m4_version_compare],
(m4_split(m4_version_unletter([$2]), [\.])))])
-# m4_PACKAGE_NAME
-# m4_PACKAGE_TARNAME
-# m4_PACKAGE_VERSION
-# m4_PACKAGE_STRING
-# m4_PACKAGE_BUGREPORT
-# --------------------
-m4_include([m4sugar/version.m4])
-
-
# m4_version_prereq(VERSION, [IF-OK], [IF-NOT = FAIL])
# ----------------------------------------------------
# Check this Autoconf version against VERSION.
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.215
diff -p -u -r1.215 output.c
--- src/output.c 13 Dec 2002 08:31:23 -0000 1.215
+++ src/output.c 26 Dec 2002 08:20:27 -0000
@@ -513,7 +513,7 @@ output_skeleton (void)
FILE *in;
FILE *out;
int filter_fd[2];
- char const *argv[7];
+ char const *argv[6];
pid_t pid;
/* Compute the names of the package data dir and skeleton file.
@@ -521,6 +521,8 @@ output_skeleton (void)
installation. A faulty installation can cause deadlock, so a
cheap sanity check is worthwhile. */
char const m4sugar[] = "m4sugar/m4sugar.m4";
+ char *full_m4sugar;
+ char *full_cm4;
char *full_path;
char const *p;
char const *m4 = (p = getenv ("M4")) ? p : M4;
@@ -535,25 +537,29 @@ output_skeleton (void)
strcpy (full_path, pkgdatadir);
full_path[pkgdatadirlen] = '/';
strcpy (full_path + pkgdatadirlen + 1, m4sugar);
- xfclose (xfopen (full_path, "r"));
+ full_m4sugar = xstrdup (full_path);
+ strcpy (full_path + pkgdatadirlen + 1, "c.m4");
+ full_cm4 = xstrdup (full_path);
strcpy (full_path + pkgdatadirlen + 1, skeleton);
+ xfclose (xfopen (full_m4sugar, "r"));
/* Create an m4 subprocess connected to us via two pipes. */
if (trace_flag & trace_tools)
- fprintf (stderr, "running: %s -I %s %s - %s\n",
- m4, pkgdatadir, m4sugar, full_path);
+ fprintf (stderr, "running: %s %s - %s %s\n",
+ m4, full_m4sugar, full_cm4, full_path);
argv[0] = m4;
- argv[1] = "-I";
- argv[2] = pkgdatadir;
- argv[3] = m4sugar;
- argv[4] = "-";
- argv[5] = full_path;
- argv[6] = NULL;
+ argv[1] = full_m4sugar;
+ argv[2] = "-";
+ argv[3] = full_cm4;
+ argv[4] = full_path;
+ argv[5] = NULL;
init_subpipe ();
pid = create_subpipe (argv, filter_fd);
+ free (full_m4sugar);
+ free (full_cm4);
free (full_path);
out = fdopen (filter_fd[0], "w");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- patch for "c.m4 is in my working directory" bug,
Paul Eggert <=