mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
'_' character wasn't treated as acceptable $variable_name character.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@986 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
6574712b4b
commit
210409bc0b
@ -28,6 +28,9 @@
|
|||||||
#define ALIGN_RIGHT 0x01
|
#define ALIGN_RIGHT 0x01
|
||||||
#define ALIGN_CUT 0x02
|
#define ALIGN_CUT 0x02
|
||||||
|
|
||||||
|
#define isvarchar(c) \
|
||||||
|
(isalnum(c) || (c) == '_')
|
||||||
|
|
||||||
static SPECIAL_HISTORY_FUNC history_func = NULL;
|
static SPECIAL_HISTORY_FUNC history_func = NULL;
|
||||||
|
|
||||||
static char *get_argument(char **cmd, char **arglist)
|
static char *get_argument(char **cmd, char **arglist)
|
||||||
@ -128,7 +131,7 @@ static char *get_long_variable(char **cmd, SERVER_REC *server,
|
|||||||
|
|
||||||
/* get variable name */
|
/* get variable name */
|
||||||
start = *cmd;
|
start = *cmd;
|
||||||
while (isalnum((*cmd)[1])) (*cmd)++;
|
while (isvarchar((*cmd)[1])) (*cmd)++;
|
||||||
|
|
||||||
var = g_strndup(start, (int) (*cmd-start)+1);
|
var = g_strndup(start, (int) (*cmd-start)+1);
|
||||||
ret = get_long_variable_value(var, server, item, free_ret);
|
ret = get_long_variable_value(var, server, item, free_ret);
|
||||||
@ -149,7 +152,7 @@ static char *get_variable(char **cmd, SERVER_REC *server, void *item,
|
|||||||
return get_argument(cmd, arglist);
|
return get_argument(cmd, arglist);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isalpha(**cmd) && isalnum((*cmd)[1])) {
|
if (isalpha(**cmd) && isvarchar((*cmd)[1])) {
|
||||||
/* long variable name.. */
|
/* long variable name.. */
|
||||||
return get_long_variable(cmd, server, item, free_ret);
|
return get_long_variable(cmd, server, item, free_ret);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user