X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/08af01c2fc26eeb77afe3a667dded68c52ea3c37..9b33de72cd2469bedac2b5f0a48a8782571ea9db:/src/output.c diff --git a/src/output.c b/src/output.c index 8a4b64f3..ef7683ec 100644 --- a/src/output.c +++ b/src/output.c @@ -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. */ @@ -595,12 +598,6 @@ prepare (void) DEFINE (spec_verbose_file); #undef DEFINE - /* User Code. */ - obstack_1grow (&pre_prologue_obstack, 0); - obstack_1grow (&post_prologue_obstack, 0); - muscle_insert ("pre_prologue", obstack_finish (&pre_prologue_obstack)); - muscle_insert ("post_prologue", obstack_finish (&post_prologue_obstack)); - /* Find the right skeleton file, and add muscles about the skeletons. */ if (skeleton) MUSCLE_INSERT_C_STRING ("skeleton", skeleton); @@ -639,6 +636,4 @@ output (void) output_skeleton (); obstack_free (&format_obstack, NULL); - obstack_free (&pre_prologue_obstack, NULL); - obstack_free (&post_prologue_obstack, NULL); }