mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Don't crash if special vars line ends with '$'.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2488 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
81c2e557d1
commit
490e411814
@ -362,6 +362,8 @@ char *parse_special(char **cmd, SERVER_REC *server, void *item,
|
|||||||
int brackets, nest_free;
|
int brackets, nest_free;
|
||||||
|
|
||||||
*free_ret = FALSE;
|
*free_ret = FALSE;
|
||||||
|
if (**cmd == '\0')
|
||||||
|
return NULL;
|
||||||
|
|
||||||
command = **cmd; (*cmd)++;
|
command = **cmd; (*cmd)++;
|
||||||
switch (command) {
|
switch (command) {
|
||||||
|
@ -146,7 +146,9 @@ static void theme_format_append_variable(GString *str, const char **format)
|
|||||||
value = parse_special((char **) format, NULL, NULL,
|
value = parse_special((char **) format, NULL, NULL,
|
||||||
args, &free_ret, NULL, PARSE_FLAG_ONLY_ARGS);
|
args, &free_ret, NULL, PARSE_FLAG_ONLY_ARGS);
|
||||||
if (free_ret) g_free(value);
|
if (free_ret) g_free(value);
|
||||||
(*format)++;
|
|
||||||
|
if (**format != '\0')
|
||||||
|
(*format)++;
|
||||||
|
|
||||||
/* append the variable name */
|
/* append the variable name */
|
||||||
value = g_strndup(orig, (int) (*format-orig));
|
value = g_strndup(orig, (int) (*format-orig));
|
||||||
|
Loading…
Reference in New Issue
Block a user