* src/parse-gram.y (add_param): Fix the truncation of trailing

spaces.
This commit is contained in:
Akim Demaille
2004-10-06 15:52:24 +00:00
parent 2c0ddf03ab
commit e503aa60d5
3 changed files with 12 additions and 5 deletions

View File

@@ -1,3 +1,8 @@
2004-10-06 Akim Demaille <akim@epita.fr>
* src/parse-gram.y (add_param): Fix the truncation of trailing
spaces.
2004-10-05 Akim Demaille <akim@epita.fr>
In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless

View File

@@ -2024,17 +2024,18 @@ add_param (char const *type, char *decl, location loc)
char const *name_start = NULL;
char *p;
for (p = decl; *p; p++)
for (p = decl; p[1]; p++)
if ((p == decl
|| ! memchr (alphanum, p[-1], sizeof alphanum))
&& memchr (alphanum, p[0], sizeof alphanum - 10))
name_start = p;
fprintf (stderr, "DECLI: {%s}(%c)\n", decl, *p);
/* Strip the surrounding '{' and '}', and any blanks just inside
the braces. */
while (*--p == ' ' || *p == '\t')
continue;
*p = '\0';
p[1] = '\0';
fprintf (stderr, "DECLO: {%s}\n", decl);
while (*++decl == ' ' || *decl == '\t')
continue;

View File

@@ -480,7 +480,8 @@ add_param (char const *type, char *decl, location loc)
char const *name_start = NULL;
char *p;
for (p = decl; *p; p++)
/* Stop on last actual character. */
for (p = decl; p[1]; p++)
if ((p == decl
|| ! memchr (alphanum, p[-1], sizeof alphanum))
&& memchr (alphanum, p[0], sizeof alphanum - 10))
@@ -490,7 +491,7 @@ add_param (char const *type, char *decl, location loc)
the braces. */
while (*--p == ' ' || *p == '\t')
continue;
*p = '\0';
p[1] = '\0';
while (*++decl == ' ' || *decl == '\t')
continue;