[SV 45049] Check for '$' being the last character in a string.

* expand.c (variable_expand_string): Add a single '$' if '$' ends the
string.
* read.c (find_char_unquote, get_next_mword): Stop if '$' ends the
string.
* variable.c (parse_variable_definition): Ditto.
This commit is contained in:
Paul Smith
2015-07-12 13:25:16 -04:00
parent 9ef06be018
commit 0205d3d08c
3 changed files with 12 additions and 5 deletions

View File

@@ -1445,6 +1445,8 @@ parse_variable_definition (const char *p, struct variable *var)
closeparen = ')';
else if (c == '{')
closeparen = '}';
else if (c == '\0')
return NULL;
else
/* '$$' or '$X'. Either way, nothing special to do here. */
continue;