summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-19 22:44:04 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-19 22:44:04 +0000
commit879702897be8d953ff4c2f8152d9ae3f77fb21a4 (patch)
treea8063123d56488a72c60047e19c016942868f4da /src/core
parent1efdf062c6529871c4fe3bc497138f91a72ada02 (diff)
downloadirssi-879702897be8d953ff4c2f8152d9ae3f77fb21a4.zip
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
Diffstat (limited to 'src/core')
-rw-r--r--src/core/special-vars.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/core/special-vars.c b/src/core/special-vars.c
index 196a2cae..f1563238 100644
--- a/src/core/special-vars.c
+++ b/src/core/special-vars.c
@@ -546,25 +546,28 @@ void eval_special_string(const char *cmd, const char *data,
/* get a list of all the commands to run */
orig = start = str = g_strdup(cmd);
do {
- if (is_split_char(str, start))
+ if (is_split_char(str, start)) {
*str++ = '\0';
- else if (*str != '\0') {
+ while (*str == ' ') str++;
+ } else if (*str != '\0') {
str++;
continue;
}
ret = parse_special_string(start, server, item,
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) {
- /* no command char - let's put it there.. */
- char *old = ret;
+ if (strchr(cmdchars, *ret) == NULL) {
+ /* no command char - let's put it there.. */
+ char *old = ret;
- ret = g_strdup_printf("%c%s", *cmdchars, old);
- g_free(old);
+ ret = g_strdup_printf("%c%s", *cmdchars, old);
+ g_free(old);
+ }
+ commands = g_slist_append(commands, ret);
}
- commands = g_slist_append(commands, ret);
start = str;
} while (*start != '\0');