* src/output.c (output_parser): Assert `skeleton'.

* src/files.c (skeleton_find): Look harder for skeletons on DOSish
systems.
From Shura.
This commit is contained in:
Akim Demaille
2001-10-02 14:48:53 +00:00
parent f40703a29a
commit 445cb4e989
4 changed files with 45 additions and 11 deletions
+9 -2
View File
@@ -1,14 +1,21 @@
2001-10-02 Akim Demaille <[email protected]>
* src/output.c (output_parser): Assert `skeleton'.
* src/files.c (skeleton_find): Look harder for skeletons on DOSish
systems.
From Shura.
2001-10-01 Marc Autret <[email protected]> 2001-10-01 Marc Autret <[email protected]>
* src/lex.h: Echo modifications. * src/lex.h: Echo modifications.
* src/lex.c (unlex): Parameter is now token_t. * src/lex.c (unlex): Parameter is now token_t.
From Hans Aberg. From Hans Aberg.
2001-10-01 Marc Autret <[email protected]> 2001-10-01 Marc Autret <[email protected]>
* src/main.c: Include lex.h. * src/main.c: Include lex.h.
From Hans Aberg. From Hans Aberg.
2001-09-29 Akim Demaille <[email protected]> 2001-09-29 Akim Demaille <[email protected]>
* src/getargs.c (longopts): `--debug' is `-t', not `-d'. * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
+1
View File
@@ -20,6 +20,7 @@ Paul Eggert [email protected]
Piotr Gackiewicz [email protected] Piotr Gackiewicz [email protected]
Richard Stallman [email protected] Richard Stallman [email protected]
Robert Anisko [email protected] Robert Anisko [email protected]
Shura [email protected]
Many people are not named here because we lost track of them. We Many people are not named here because we lost track of them. We
thank them! Please, help us keeping this list up to date. thank them! Please, help us keeping this list up to date.
+34 -9
View File
@@ -200,17 +200,42 @@ skeleton_find (const char *envvar, const char *skeleton_name)
{ {
const char *res = getenv (envvar); const char *res = getenv (envvar);
#ifdef MSDOS #if defined (MSDOS) || defined (_WIN32)
const char *cp; if (!res)
/* File doesn't exist in current directory; try in INIT directory. */
if (!res && (cp = getenv ("INIT")))
{ {
res = XMALLOC (char, strlen (cp) + strlen (skeleton_name) + 2); /* Skeleton file name without path */
sprintf (res, "%s%c%s", cp, '/', skeleton_name); const char *skel_name = strrchr(skeleton_name, '/');
} if (!skel_name)
#endif /* !MSDOS */ skel_name = strrchr(skeleton_name, '\\');
if (!skel_name)
skel_name = skeleton_name;
else
++skel_name;
/* File doesn't exist in current directory; try in INIT directory. */
const char *cp = getenv ("INIT");
if (cp)
{
res = XMALLOC (char, strlen (cp) + strlen (skel_name) + 2);
sprintf (res, "%s%c%s", cp, '\\', skel_name);
}
else if (access (skel_name, 4) == 0) /* Look in current dir. */
res = skel_name;
else
{
/* Look in program locations dir. */
extern char *program_name;
cp = strrchr(program_name, '\\');
if (!cp)
return skeleton_name;
else
++cp;
res = XMALLOC (char, cp - program_name + strlen (skel_name) + 1);
strncpy (res, program_name, cp - program_name);
strcpy (res + (cp - program_name), skel_name);
}
}
#endif /* defined (MSDOS) || defined (_WIN32) */
if (!res) if (!res)
res = skeleton_name; res = skeleton_name;
+1
View File
@@ -1160,6 +1160,7 @@ output_parser (void)
else else
skeleton = skeleton_find ("BISON_SIMPLE", BISON_SIMPLE); skeleton = skeleton_find ("BISON_SIMPLE", BISON_SIMPLE);
} }
assert (skeleton);
fskel = xfopen (skeleton, "r"); fskel = xfopen (skeleton, "r");
/* Set LINE to 2, not 1: `#line LINENUM' -- Here LINENUM is a /* Set LINE to 2, not 1: `#line LINENUM' -- Here LINENUM is a