[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: file extensions
From: |
marc-alexandre autret |
Subject: |
FYI: file extensions |
Date: |
Tue, 14 Aug 2001 12:35:44 +0000 (GMT) |
Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.165
diff -u -r1.165 ChangeLog
--- ChangeLog 2001/08/13 21:37:22 1.165
+++ ChangeLog 2001/08/14 10:28:49
@@ -1,3 +1,9 @@
+2001-08-14 Marc Autret <address@hidden>
+
+ * src/files.c (compute_base_names): Add extensions computing when
+ `--file-prefix' used.
+ Standardize function calls.
+
2001-08-13 Marc Autret <address@hidden>
* src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
Index: src/files.c
===================================================================
RCS file: /cvsroot/bison/bison/src/files.c,v
retrieving revision 1.46
diff -u -r1.46 files.c
--- src/files.c 2001/08/07 07:58:43 1.46
+++ src/files.c 2001/08/14 10:28:51
@@ -264,11 +264,11 @@
/* if the initial segment of extension contains 'c' or a 'C', I assume
that it is a C or C++ source file */
if (ext_index)
- ext_index = (strspn(spec_outfile + ext_index + 1, "cC")) ? ext_index :
0;
+ ext_index = (strspn (spec_outfile + ext_index + 1, "cC")) ? ext_index :
0;
if (ext_index)
{
base_length -= strlen (spec_outfile + ext_index);
- compute_exts_from_src(spec_outfile + ext_index);
+ compute_exts_from_src (spec_outfile + ext_index);
}
base_name = strndup (spec_outfile, base_length);
@@ -295,6 +295,15 @@
strlen (short_base_name) + strlen (EXT_TAB) + 1);
stpcpy (stpcpy (base_name, short_base_name), EXT_TAB);
+ /* Computes the extensions from the garmmar file name. */
+ ext_index = get_extension_index (infile);
+ /* if the initial segment of extension contains a 'y' or a 'Y', I assume
+ that it is a yacc or bison grammar file */
+ if (ext_index)
+ ext_index = (strspn (infile + ext_index + 1, "yY")) ? ext_index : 0;
+ if (ext_index)
+ compute_exts_from_gf (infile + ext_index);
+
return;
}
@@ -314,11 +323,11 @@
/* if the initial segment of extension contains a 'y' or a 'Y', I assume
that it is a yacc or bison grammar file */
if (ext_index)
- ext_index = (strspn(name_base + ext_index + 1, "yY")) ? ext_index : 0;
+ ext_index = (strspn (name_base + ext_index + 1, "yY")) ? ext_index : 0;
if (ext_index)
{
base_length -= strlen (name_base + ext_index);
- compute_exts_from_gf(name_base + ext_index);
+ compute_exts_from_gf (name_base + ext_index);
}
short_base_length = base_length;
--
Autret Marc (address@hidden)
Eleve Ingenieur en Informatique
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: file extensions,
marc-alexandre autret <=