From 24886ed306c3097b561b76292464d114697f88c5 Mon Sep 17 00:00:00 2001 From: Arturo Espinosa Date: Fri, 7 Aug 1998 02:54:29 +0000 Subject: [PATCH] More exciting work! --- ChangeLog-1999-07-09 | 2 ++ ChangeLog-2000-02-23 | 2 ++ OChangeLog-1999-07-09 | 2 ++ OChangeLog-2000-02-23 | 2 ++ src/parser.y | 15 +++++++++------ 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog-1999-07-09 b/ChangeLog-1999-07-09 index 7f81b67e4..8f8ea9b52 100644 --- a/ChangeLog-1999-07-09 +++ b/ChangeLog-1999-07-09 @@ -1,5 +1,7 @@ 1998-08-06 Miguel de Icaza + * src/parser.y (yylex): Bug fix: allocate the string. + * src/sheet.c (CRowSort): Sort in the other direction my list of cells. (sheet_cell_foreach_range): Iterate over the lists with ->next, diff --git a/ChangeLog-2000-02-23 b/ChangeLog-2000-02-23 index 7f81b67e4..8f8ea9b52 100644 --- a/ChangeLog-2000-02-23 +++ b/ChangeLog-2000-02-23 @@ -1,5 +1,7 @@ 1998-08-06 Miguel de Icaza + * src/parser.y (yylex): Bug fix: allocate the string. + * src/sheet.c (CRowSort): Sort in the other direction my list of cells. (sheet_cell_foreach_range): Iterate over the lists with ->next, diff --git a/OChangeLog-1999-07-09 b/OChangeLog-1999-07-09 index 7f81b67e4..8f8ea9b52 100644 --- a/OChangeLog-1999-07-09 +++ b/OChangeLog-1999-07-09 @@ -1,5 +1,7 @@ 1998-08-06 Miguel de Icaza + * src/parser.y (yylex): Bug fix: allocate the string. + * src/sheet.c (CRowSort): Sort in the other direction my list of cells. (sheet_cell_foreach_range): Iterate over the lists with ->next, diff --git a/OChangeLog-2000-02-23 b/OChangeLog-2000-02-23 index 7f81b67e4..8f8ea9b52 100644 --- a/OChangeLog-2000-02-23 +++ b/OChangeLog-2000-02-23 @@ -1,5 +1,7 @@ 1998-08-06 Miguel de Icaza + * src/parser.y (yylex): Bug fix: allocate the string. + * src/sheet.c (CRowSort): Sort in the other direction my list of cells. (sheet_cell_foreach_range): Iterate over the lists with ->next, diff --git a/src/parser.y b/src/parser.y index 3b7982f35..bf383be02 100644 --- a/src/parser.y +++ b/src/parser.y @@ -86,6 +86,7 @@ line: exp { parser_result = $1; ; exp: NUMBER { $$ = $1 } + | STRING { $$ = $1 } | CELLREF { $$ = $1 } | CONSTANT { $$ = $1 } | exp '+' exp { @@ -394,7 +395,8 @@ int yylex (void) return NUMBER; } case '"': { - char *string; + char *string, *s; + int v; p = parser_expr; while(*parser_expr && *parser_expr != '"') { @@ -407,19 +409,20 @@ int yylex (void) return ERROR; } - string = (char *) alloca (1 + parser_expr - p); + s = string = (char *) alloca (1 + parser_expr - p); while (p != parser_expr){ if (*p== '\\'){ p++; - *string++ = *p++; + *s++ = *p++; } else - *string++ = *p++; + *s++ = *p++; } - *string = 0; + *s = 0; parser_expr++; - return return_symbol (string); + v = return_symbol (string); + return v; } } -- GitLab