Implement support for relative and absolute skeleton file names.

Discussed starting at
<http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
* doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
(Bison Options): Document in --skeleton entry.
* src/output.c (output_skeleton): Use strncpy rather than strcpy since
full_skeleton can't necessarily hold all of pkgdatadir.
If the specified skeleton file name contains a `/', don't prepend
pkgdatadir.
* src/parse-gram.y (prologue_declaration): If the specified skeleton
file name contains a `/', prepend the grammar file directory.
* tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
* skeletons.at: New file.
(relative skeleton file names): New test case.
(installed skeleton file names): New test case.
* tests/testsuite.at: Include skeletons.at.

* bootstrap: Update copyright to 2007.
This commit is contained in:
Joel E. Denny
2007-01-18 02:18:17 +00:00
parent 830c9b1847
commit a7867f53b3
9 changed files with 309 additions and 81 deletions

View File

@@ -492,13 +492,16 @@ output_skeleton (void)
full_skeleton = xmalloc (pkgdatadirlen + 1
+ (skeleton_size < sizeof m4sugar
? sizeof m4sugar : skeleton_size));
strcpy (full_skeleton, pkgdatadir);
strncpy (full_skeleton, pkgdatadir, pkgdatadirlen);
full_skeleton[pkgdatadirlen] = '/';
strcpy (full_skeleton + pkgdatadirlen + 1, m4sugar);
full_m4sugar = xstrdup (full_skeleton);
strcpy (full_skeleton + pkgdatadirlen + 1, m4bison);
full_m4bison = xstrdup (full_skeleton);
strcpy (full_skeleton + pkgdatadirlen + 1, skeleton);
if (strchr (skeleton, '/'))
strcpy (full_skeleton, skeleton);
else
strcpy (full_skeleton + pkgdatadirlen + 1, skeleton);
xfclose (xfopen (full_m4sugar, "r"));
/* Create an m4 subprocess connected to us via two pipes. */