]> git.saurik.com Git - bison.git/commitdiff
* src/output.c (output_headers, output_program, output): Be sure
authorAkim Demaille <akim@epita.fr>
Tue, 12 Dec 2000 16:09:10 +0000 (16:09 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 12 Dec 2000 16:09:10 +0000 (16:09 +0000)
to escape special characters when outputting filenames.
(ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
(output_headers): Don't depend on them, Use ACTSTR.

ChangeLog
po/de.po
po/es.po
po/et.po
po/fr.po
po/ja.po
po/nl.po
po/ru.po
src/output.c

index 6f138ef89f13c7c6fd1682b88657c5aada74291d..49b30cc412900a6fe56f0ced269784923ea2ffae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-12-12  Akim Demaille  <akim@epita.fr>
+
+       * src/output.c (output_headers, output_program, output): Be sure
+       to escape special characters when outputting filenames.
+       (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
+       (output_headers): Don't depend on them, Use ACTSTR.
+
 2000-11-17  Akim Demaille  <akim@epita.fr>
 
        * lib/obstack.h: Formatting changes.
index 809f121818942c63a6114bda48fa7ed26d89a4e5..1b7ff8fa301c9ef564c1155b01a78692878b92a7 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2000-11-07 17:07+0100\n"
+"POT-Creation-Date: 2000-11-17 16:54+0100\n"
 "PO-Revision-Date: 1996-10-10 17:54 MET DST\n"
 "Last-Translator: Ulrich Drepper <drepper@gnu.ai.mit.edu>\n"
 "Language-Team: German <de@li.org>\n"
index 3e2547a3f56f4c94a9a24162efe8601e8eba9f10..86b1c979de1539f54dd3af7ee92b700c4882b8fe 100644 (file)
--- a/po/es.po
+++ b/po/es.po
@@ -30,7 +30,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GNU bison 1.25\n"
-"POT-Creation-Date: 2000-11-07 17:07+0100\n"
+"POT-Creation-Date: 2000-11-17 16:54+0100\n"
 "PO-Revision-Date: 1998-09-21 10:19+0200\n"
 "Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n"
 "Language-Team: Spanish <es@li.org>\n"
index ae4ee20ef0c53ee9ae30c596a3e2808d5a96c0a9..9a431423a20ab49c4ccedb4ad1d358dd09a59952 100644 (file)
--- a/po/et.po
+++ b/po/et.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2000-11-07 17:07+0100\n"
+"POT-Creation-Date: 2000-11-17 16:54+0100\n"
 "PO-Revision-Date: 2000-04-11 22:19+02:00\n"
 "Last-Translator: Toomas Soome <tsoome@ut.ee>\n"
 "Language-Team: Estonian <et@li.org>\n"
index c73171436379c4b0b675cb7a7dc80a51b051fa11..bd2161009746f82e1efc633f97fd891c9e8c7ee9 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2000-11-07 17:07+0100\n"
+"POT-Creation-Date: 2000-11-17 16:54+0100\n"
 "PO-Revision-Date: 1996-03-19 20:05 EST\n"
 "Last-Translator: Dominique Boucher <boucherd@IRO.UMontreal.CA>\n"
 "Language-Team: French <fr@li.org>\n"
index 95f9a0e24fb4358f2fc4be90b82b9da41a3a64cf..7f6729fa481e6e3b714c055f91fd65454f79108e 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GNU bison 1.28\n"
-"POT-Creation-Date: 2000-11-07 17:07+0100\n"
+"POT-Creation-Date: 2000-11-17 16:54+0100\n"
 "PO-Revision-Date: 1999-09-28 21:10+0900\n"
 "Last-Translator: Daisuke Yamashita <yamad@mb.infoweb.ne.jp>\n"
 "Language-Team: Japanese <ja@li.org>\n"
index dd9911cff66566b7a5fc9d2f40184e2453ac5cb4..8dead27fe2d451dc54b727322a4d4cfe7e74dc7c 100644 (file)
--- a/po/nl.po
+++ b/po/nl.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2000-11-07 17:07+0100\n"
+"POT-Creation-Date: 2000-11-17 16:54+0100\n"
 "PO-Revision-Date: 1996-08-27 15:34 MET DST\n"
 "Last-Translator: Erick Branderhorst <branderh@debian.org>\n"
 "Language-Team: Dutch <nl@li.org>\n"
index 772a84a828676fdca21d1c922c1522c99b6f0da5..8327872d9aad42033bce16e907fdf553022b883c 100644 (file)
--- a/po/ru.po
+++ b/po/ru.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.28a\n"
-"POT-Creation-Date: 2000-11-07 17:07+0100\n"
+"POT-Creation-Date: 2000-11-17 16:54+0100\n"
 "PO-Revision-Date: 2000-04-12 13:16+04:00\n"
 "Last-Translator: Dmitry S. Sivachenko <dima@Chg.RU>\n"
 "Language-Team: Russian <ru@li.org>\n"
index fbe007eaf164ebecf12e04719c7a6a0151f2de06..27fcae4f2aadaa68ec07c441263f972aac876b14 100644 (file)
@@ -92,6 +92,7 @@
 
 #include "system.h"
 #include "obstack.h"
+#include "quotearg.h"
 #include "getargs.h"
 #include "xalloc.h"
 #include "files.h"
@@ -182,9 +183,11 @@ output_short_table (struct obstack *oout,
 | certain files.                                                |
 `--------------------------------------------------------------*/
 
+/* Don't put the `%s' insides quotes, since it quotearg puts them. */
+
 #define        GUARDSTR        \
 "\n\
-#include \"%s\"\n\
+#include %s\n\
 extern int yyerror;\n\
 extern int yycost;\n\
 extern char * yymsg;\n\
@@ -203,24 +206,7 @@ register YYLTYPE *yylsp;\n\
 
 #define        ACTSTR          \
 "\n\
-#include \"%s\"\n\
-extern YYSTYPE yyval;\n\
-extern int yychar;\n\
-\n\
-yyaction(n, yyvsp, yylsp)\n\
-register int n;\n\
-register YYSTYPE *yyvsp;\n\
-register YYLTYPE *yylsp;\n\
-{\n\
-  switch (n)\n\
-    {"
-
-#define        ACTSTR_PROLOGUE         \
-"\n\
-#include \""
-
-#define        ACTSTR_EPILOGUE         \
-"\"\n\
+#include %s\n\
 extern YYSTYPE yyval;\n\
 extern int yychar;\n\
 \n\
@@ -237,25 +223,18 @@ register YYLTYPE *yylsp;\n\
 void
 output_headers (void)
 {
+  char *attrsfile_quoted = quotearg_style (c_quoting_style, attrsfile);
+
   if (semantic_parser)
-    fprintf (fguard, GUARDSTR, attrsfile);
+    fprintf (fguard, GUARDSTR, attrsfile_quoted);
 
   if (no_parser_flag)
     return;
 
   if (semantic_parser)
-    {
-      obstack_grow_literal_string (&action_obstack,
-                                  ACTSTR_PROLOGUE);
-      obstack_grow (&action_obstack,
-                    attrsfile, strlen (attrsfile));
-      obstack_grow_literal_string (&action_obstack,
-                                  ACTSTR_EPILOGUE);
-   }
+    obstack_fgrow1 (&action_obstack, ACTSTR, attrsfile_quoted);
   else
-   {
-      obstack_grow_literal_string (&action_obstack, ACTSTR_SIMPLE);
-   }
+    obstack_grow_literal_string (&action_obstack, ACTSTR_SIMPLE);
 
 /*  if (semantic_parser)       JF moved this below
     fprintf(ftable, "#include \"%s\"\n", attrsfile);
@@ -266,19 +245,19 @@ output_headers (void)
   if (spec_name_prefix)
     {
       obstack_fgrow1 (&table_obstack,
-                       "#define yyparse %sparse\n", spec_name_prefix);
+                     "#define yyparse %sparse\n", spec_name_prefix);
       obstack_fgrow1 (&table_obstack,
-                       "#define yylex %slex\n", spec_name_prefix);
+                     "#define yylex %slex\n", spec_name_prefix);
       obstack_fgrow1 (&table_obstack,
-                       "#define yyerror %serror\n", spec_name_prefix);
+                     "#define yyerror %serror\n", spec_name_prefix);
       obstack_fgrow1 (&table_obstack,
-                       "#define yylval %slval\n", spec_name_prefix);
+                     "#define yylval %slval\n", spec_name_prefix);
       obstack_fgrow1 (&table_obstack,
-                       "#define yychar %schar\n", spec_name_prefix);
+                     "#define yychar %schar\n", spec_name_prefix);
       obstack_fgrow1 (&table_obstack,
-                       "#define yydebug %sdebug\n", spec_name_prefix);
+                     "#define yydebug %sdebug\n", spec_name_prefix);
       obstack_fgrow1 (&table_obstack,
-                       "#define yynerrs %snerrs\n", spec_name_prefix);
+                     "#define yynerrs %snerrs\n", spec_name_prefix);
     }
 }
 
@@ -299,12 +278,9 @@ output_trailers (void)
     return;
 
   if (semantic_parser)
-    {
-      obstack_grow_literal_string (&action_obstack,
-                                  "    }\n");
-    }
-  obstack_grow_literal_string (&action_obstack,
-                              "}\n");
+    obstack_grow_literal_string (&action_obstack, "    }\n");
+
+  obstack_grow_literal_string (&action_obstack, "}\n");
 }
 
 
@@ -1275,14 +1251,11 @@ output_program (void)
   int c;
 
   if (!no_lines_flag)
-    obstack_fgrow2 (&table_obstack, "#line %d \"%s\"\n", lineno, infile);
+    obstack_fgrow2 (&table_obstack, "#line %d %s\n",
+                   lineno, quotearg_style (c_quoting_style, infile));
 
-  c = getc (finput);
-  while (c != EOF)
-    {
-      obstack_1grow (&table_obstack, c);
-      c = getc (finput);
-    }
+  while ((c = getc (finput)) != EOF)
+    obstack_1grow (&table_obstack, c);
 }
 
 
@@ -1326,7 +1299,8 @@ output (void)
 \n");
 
   if (semantic_parser)
-    obstack_fgrow1 (&table_obstack, "#include \"%s\"\n", attrsfile);
+    obstack_fgrow1 (&table_obstack, "#include %s\n",
+                   quotearg_style (c_quoting_style, attrsfile));
 
   if (!no_parser_flag)
     obstack_grow_literal_string (&table_obstack, "#include <stdio.h>\n\n");