]> git.saurik.com Git - bison.git/commitdiff
* tests/regression.at (Invalid CPP headers): New.
authorAkim Demaille <akim@epita.fr>
Tue, 2 Oct 2001 16:17:41 +0000 (16:17 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 2 Oct 2001 16:17:41 +0000 (16:17 +0000)
From Alexander Belopolsky.
* src/files.c (compute_header_macro): Map non alnum chars to `_'.

ChangeLog
THANKS
src/files.c
tests/regression.at

index 47bbaada0ec3969fb9fc5c21acb379e7537a3247..93e261b0444c5ffea926085eae028a999991e606 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-02  Akim Demaille  <akim@epita.fr>
+
+       * tests/regression.at (Invalid CPP headers): New.
+       From Alexander Belopolsky.
+       * src/files.c (compute_header_macro): Map non alnum chars to `_'.
+
 2001-10-02  Akim Demaille  <akim@epita.fr>
 
        * tests/regression.at (Invalid input): New.
diff --git a/THANKS b/THANKS
index 527abd8981a7b73bfdf7b641c8def09de41dc486..7cf068c680f613394063258242615907b8f5908e 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,24 +1,25 @@
 Bison was originally written by Robert Corbett.  It would not be what
 it is today without the invaluable help of these people:
 
-Akim Demaille          akim@epita.fr
+Akim Demaille           akim@epita.fr
 Albert Chin-A-Young     china@thewrittenword.com
-Daniel Hagerty         hag@gnu.org
-David J. MacKenzie     djm@gnu.org
-Fabrice Bauzac         noon@cote-dazur.com
-Hans Aberg             haberg@matematik.su.se
-Jesse Thilo            jthilo@gnu.org
-Jim Meyering           meyering@gnu.org
-Juan Manuel Guerrero   ST001906@HRZ1.HRZ.TU-Darmstadt.De
-Keith Browne           kbrowne@legato.com
-Laurent Mascherpa      laurent.mascherpa@epita.fr
+Alexander Belopolsky    alexb@rentec.com
+Daniel Hagerty          hag@gnu.org
+David J. MacKenzie      djm@gnu.org
+Fabrice Bauzac          noon@cote-dazur.com
+Hans Aberg              haberg@matematik.su.se
+Jesse Thilo             jthilo@gnu.org
+Jim Meyering            meyering@gnu.org
+Juan Manuel Guerrero    ST001906@HRZ1.HRZ.TU-Darmstadt.De
+Keith Browne            kbrowne@legato.com
+Laurent Mascherpa       laurent.mascherpa@epita.fr
 Marc Autret             autret_m@epita.fr
-Neil Booth             NeilB@earthling.net
-Noah Friedman                  friedman@gnu.org
+Neil Booth              NeilB@earthling.net
+Noah Friedman           friedman@gnu.org
 Pascal Bart             pascal.bart@epita.fr
-Paul Eggert            eggert@twinsun.com
-Piotr Gackiewicz       gacek@intertel.com.pl
-Richard Stallman       rms@gnu.org
+Paul Eggert             eggert@twinsun.com
+Piotr Gackiewicz        gacek@intertel.com.pl
+Richard Stallman        rms@gnu.org
 Robert Anisko           anisko_r@epita.fr
 Shura                   debil_urod@ngs.ru
 
index aff55bbf9eb2d768197a275faec828975257320f..19d14c157ea0c45efb32ca6719a33c99a4bb733a 100644 (file)
@@ -94,8 +94,7 @@ stringappend (const char *string1, const char *string2)
 static char *
 compute_header_macro (void)
 {
-  int ite;
-  char *macro_name;
+  char *macro_name, *cp;
 
   if (spec_defines_file)
     macro_name = xstrdup (spec_defines_file);
@@ -109,14 +108,12 @@ compute_header_macro (void)
       strcat (macro_name, header_extension);
     }
 
-  for (ite = 0; macro_name[ite]; ite++)
-    if (macro_name[ite] == '.')
-      macro_name[ite] = '_';
-    else
-      {
-       if (islower (macro_name[ite]))
-         macro_name[ite] -= ('a' - 'A');
-      }
+  for (cp = macro_name; *cp; ++cp)
+    if (islower (*cp))
+      *cp = toupper (*cp);
+    else if (!isalnum (*cp))
+      *cp = '_';
+
   return macro_name;
 }
 
index 9045e226783d60d48284c25f990fd4da8ded7628..2be0ea00c34f2edd7bfdfabc5ad40349086fb276 100644 (file)
@@ -107,3 +107,25 @@ input.y:3: fatal error: no rules in the input grammar
 ])
 
 AT_CLEANUP
+
+
+## --------------------- ##
+## Invalid CPP headers.  ##
+## --------------------- ##
+
+AT_SETUP([Invalid CPP headers])
+
+mkdir input
+
+AT_DATA([input/input.y],
+[%%
+dummy:
+])
+
+AT_CHECK([bison --defines input/input.y])
+
+AT_CHECK([sed 1q input/input.tab.h], 0,
+[[#ifndef INPUT_INPUT_TAB_H
+]])
+
+AT_CLEANUP(input)