mirror of
https://github.com/irssi/irssi.git
synced 2026-08-19 16:42:30 +02:00
eval_special_string() : spaces are now ignored after ';' separator (so
/alias echo foo; echo bar works properly). Also if there was any empty commands they're now ignored. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2105 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
1efdf062c6
commit
879702897b
1 changed files with 12 additions and 9 deletions
|
|
@ -546,25 +546,28 @@ void eval_special_string(const char *cmd, const char *data,
|
||||||
/* get a list of all the commands to run */
|
/* get a list of all the commands to run */
|
||||||
orig = start = str = g_strdup(cmd);
|
orig = start = str = g_strdup(cmd);
|
||||||
do {
|
do {
|
||||||
if (is_split_char(str, start))
|
if (is_split_char(str, start)) {
|
||||||
*str++ = '\0';
|
*str++ = '\0';
|
||||||
else if (*str != '\0') {
|
while (*str == ' ') str++;
|
||||||
|
} else if (*str != '\0') {
|
||||||
str++;
|
str++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = parse_special_string(start, server, item,
|
ret = parse_special_string(start, server, item,
|
||||||
data, &arg_used, 0);
|
data, &arg_used, 0);
|
||||||
if (arg_used) arg_used_ever = TRUE;
|
if (*ret != '\0') {
|
||||||
|
if (arg_used) arg_used_ever = TRUE;
|
||||||
|
|
||||||
if (strchr(cmdchars, *ret) == NULL) {
|
if (strchr(cmdchars, *ret) == NULL) {
|
||||||
/* no command char - let's put it there.. */
|
/* no command char - let's put it there.. */
|
||||||
char *old = ret;
|
char *old = ret;
|
||||||
|
|
||||||
ret = g_strdup_printf("%c%s", *cmdchars, old);
|
ret = g_strdup_printf("%c%s", *cmdchars, old);
|
||||||
g_free(old);
|
g_free(old);
|
||||||
|
}
|
||||||
|
commands = g_slist_append(commands, ret);
|
||||||
}
|
}
|
||||||
commands = g_slist_append(commands, ret);
|
|
||||||
start = str;
|
start = str;
|
||||||
} while (*start != '\0');
|
} while (*start != '\0');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue