/[bison]/bison/src/output.c
ViewVC logotype

Diff of /bison/src/output.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.155 by akim, Sun May 26 18:39:04 2002 UTC revision 1.156 by hilfinger, Mon May 27 22:33:54 2002 UTC
# Line 994  output_skeleton (void) Line 994  output_skeleton (void)
994    {    {
995      const char *bison_pkgdatadir = getenv ("BISON_PKGDATADIR");      const char *bison_pkgdatadir = getenv ("BISON_PKGDATADIR");
996      const char *m4 = getenv ("M4");      const char *m4 = getenv ("M4");
997        int pkg_data_len;
998        char *full_skeleton;
999    
1000      if (!m4)      if (!m4)
1001        m4 = M4;        m4 = M4;
1002      if (!bison_pkgdatadir)      if (!bison_pkgdatadir)
1003        bison_pkgdatadir = PKGDATADIR;        bison_pkgdatadir = PKGDATADIR;
1004        pkg_data_len = strlen (bison_pkgdatadir);
1005        full_skeleton = XMALLOC (char, pkg_data_len + strlen (skeleton) + 1);
1006        if (bison_pkgdatadir[pkg_data_len-1] == '/')
1007          sprintf (full_skeleton, "%s%s", bison_pkgdatadir, skeleton);
1008        else
1009          sprintf (full_skeleton, "%s/%s", bison_pkgdatadir, skeleton);
1010      if (trace_flag)      if (trace_flag)
1011        fprintf (stderr,        fprintf (stderr,
1012                 "running: %s -I %s m4sugar/m4sugar.m4 %s %s\n",                 "running: %s -I %s m4sugar/m4sugar.m4 %s %s\n",
1013                 m4, bison_pkgdatadir, tempfile, skeleton);                 m4, bison_pkgdatadir, tempfile, full_skeleton);
1014      skel_in = readpipe (m4,      skel_in = readpipe (m4,
1015                          "-I", bison_pkgdatadir,                          "-I", bison_pkgdatadir,
1016                          "m4sugar/m4sugar.m4",                          "m4sugar/m4sugar.m4",
1017                          tempfile,                          tempfile,
1018                          skeleton,                          full_skeleton,
1019                          NULL);                          NULL);
1020        XFREE (full_skeleton);
1021      if (!skel_in)      if (!skel_in)
1022        error (EXIT_FAILURE, errno, "cannot run m4");        error (EXIT_FAILURE, errno, "cannot run m4");
1023      skel_lex ();      skel_lex ();

Legend:
Removed from v.1.155  
changed lines
  Added in v.1.156

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26