* 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

View File

@@ -1,14 +1,21 @@
2001-10-02 Akim Demaille <akim@epita.fr>
* 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 <autret_m@epita.fr> 2001-10-01 Marc Autret <autret_m@epita.fr>
* 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 <autret_m@epita.fr> 2001-10-01 Marc Autret <autret_m@epita.fr>
* src/main.c: Include lex.h. * src/main.c: Include lex.h.
From Hans Aberg. From Hans Aberg.
2001-09-29 Akim Demaille <akim@epita.fr> 2001-09-29 Akim Demaille <akim@epita.fr>
* src/getargs.c (longopts): `--debug' is `-t', not `-d'. * src/getargs.c (longopts): `--debug' is `-t', not `-d'.

1
THANKS
View File

@@ -20,6 +20,7 @@ Paul Eggert eggert@twinsun.com
Piotr Gackiewicz gacek@intertel.com.pl Piotr Gackiewicz gacek@intertel.com.pl
Richard Stallman rms@gnu.org Richard Stallman rms@gnu.org
Robert Anisko anisko_r@epita.fr Robert Anisko anisko_r@epita.fr
Shura debil_urod@ngs.ru
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.

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;

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