mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-11-05 03:35:27 -07:00
safe parsing of "" and ''
This commit is contained in:
1 parent
247a48e5bb
commit
ad8a32ce86
1 file changed
+12
@@ -508,6 +508,12 @@ void PgfExprParser::token()
|
||||
if (ch == '\'') {
|
||||
getc();
|
||||
token_tag = PGF_TOKEN_IDENT;
|
||||
if (token_value == NULL) {
|
||||
token_value = (PgfText*)
|
||||
malloc(sizeof(PgfText)+1);
|
||||
token_value->size = 0;
|
||||
token_value->text[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -521,6 +527,12 @@ void PgfExprParser::token()
|
||||
if (ch == '"') {
|
||||
getc();
|
||||
token_tag = PGF_TOKEN_STR;
|
||||
if (token_value == NULL) {
|
||||
token_value = (PgfText*)
|
||||
malloc(sizeof(PgfText)+1);
|
||||
token_value->size = 0;
|
||||
token_value->text[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user