summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2015-11-18 22:01:29 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2015-11-18 22:01:29 +0100
commitfbb838b3b0d30ee41de648d667fa89a2d6b41076 (patch)
treed49924299ac52da43a3b23c09aa0acfcbff480fd /src/fe-common
parentac04fa741355888d814c693e7e2b793c5413c3eb (diff)
parentd4676c985553dc957e863e814097beba9bcc279e (diff)
downloadirssi-fbb838b3b0d30ee41de648d667fa89a2d6b41076.zip
Merge pull request #350 from LemonBoy/fix-99
Strip trailing whitespace from commands
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/completion.c2
-rw-r--r--src/fe-common/core/fe-channels.c3
-rw-r--r--src/fe-common/core/fe-ignore.c3
-rw-r--r--src/fe-common/core/fe-log.c5
-rw-r--r--src/fe-common/core/fe-settings.c5
-rw-r--r--src/fe-common/irc/fe-irc-commands.c4
6 files changed, 13 insertions, 9 deletions
diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c
index 4461de92..a4715d23 100644
--- a/src/fe-common/core/completion.c
+++ b/src/fe-common/core/completion.c
@@ -757,7 +757,7 @@ static void cmd_completion(const char *data)
int len;
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTIONS |
- PARAM_FLAG_GETREST,
+ PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS,
"completion", &optlist, &key, &value))
return;
diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c
index a171596d..046d641a 100644
--- a/src/fe-common/core/fe-channels.c
+++ b/src/fe-common/core/fe-channels.c
@@ -122,7 +122,8 @@ static void cmd_join(const char *data, SERVER_REC *server)
void *free_arg;
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
- PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_GETREST,
+ PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_GETREST |
+ PARAM_FLAG_STRIP_TRAILING_WS,
"join", &optlist, &pdata))
return;
diff --git a/src/fe-common/core/fe-ignore.c b/src/fe-common/core/fe-ignore.c
index 533cda31..d2f9de27 100644
--- a/src/fe-common/core/fe-ignore.c
+++ b/src/fe-common/core/fe-ignore.c
@@ -127,7 +127,8 @@ static void cmd_ignore(const char *data)
return;
}
- if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTIONS | PARAM_FLAG_GETREST,
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTIONS |
+ PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS,
"ignore", &optlist, &mask, &levels))
return;
diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c
index a39623d2..476abaab 100644
--- a/src/fe-common/core/fe-log.c
+++ b/src/fe-common/core/fe-log.c
@@ -87,8 +87,9 @@ static void cmd_log_open(const char *data)
int level;
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST |
- PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_OPTIONS,
- "log open", &optlist, &fname, &levels))
+ PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_OPTIONS |
+ PARAM_FLAG_STRIP_TRAILING_WS, "log open", &optlist,
+ &fname, &levels))
return;
if (*fname == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
diff --git a/src/fe-common/core/fe-settings.c b/src/fe-common/core/fe-settings.c
index 2627989d..3bb43bf7 100644
--- a/src/fe-common/core/fe-settings.c
+++ b/src/fe-common/core/fe-settings.c
@@ -108,7 +108,8 @@ static void cmd_set(char *data)
int clear, set_default;
SETTINGS_REC *rec;
- if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | PARAM_FLAG_OPTIONS,
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST |
+ PARAM_FLAG_OPTIONS | PARAM_FLAG_STRIP_TRAILING_WS,
"set", &optlist, &key, &value))
return;
@@ -182,7 +183,7 @@ static void cmd_toggle(const char *data)
void *free_arg;
int type;
- if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, &key, &value))
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS, &key, &value))
return;
if (*key == '\0')
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index a23facbd..11a911d2 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -246,8 +246,8 @@ static void cmd_ban(const char *data, IRC_SERVER_REC *server,
CMD_IRC_SERVER(server);
- if (!cmd_get_params(data, &free_arg, 2 |
- PARAM_FLAG_OPTCHAN | PARAM_FLAG_GETREST,
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTCHAN |
+ PARAM_FLAG_GETREST | PARAM_FLAG_STRIP_TRAILING_WS,
item, &channel, &nicks))
return;