diff options
author | Timo Sirainen <cras@irssi.org> | 2000-06-04 14:52:47 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-06-04 14:52:47 +0000 |
commit | a7f5540cba46869fda6b3da42199bb85bd6dab8b (patch) | |
tree | e769eb1a127a6706865b470273eb561f6ae72d68 /src/core/commands.c | |
parent | ee46dc71ab5fe607851bcc29f836d7f4a3d00a3e (diff) | |
download | irssi-a7f5540cba46869fda6b3da42199bb85bd6dab8b.zip |
/IRCNET command.
PARAM_FLAG_NOQUOTES flag for cmd_get_params()
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@290 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/commands.c')
-rw-r--r-- | src/core/commands.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/core/commands.c b/src/core/commands.c index 1a05e7a3..e4c7a5ff 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -352,13 +352,17 @@ char *cmd_get_params(const char *data, int count, ...) va_start(args, count); /* get the length of the arguments in string */ - old = datad = g_strdup(data); - if (count & PARAM_FLAG_MULTIARGS) - get_multi_args(&datad, TRUE, args); - else if (count & PARAM_FLAG_OPTARGS) - get_opt_args(&datad); - len = (int) (datad-old); - g_free(old); + if ((count & (PARAM_FLAG_MULTIARGS|PARAM_FLAG_OPTARGS)) == 0) + len = 0; + else { + old = datad = g_strdup(data); + if (count & PARAM_FLAG_MULTIARGS) + get_multi_args(&datad, TRUE, args); + else + get_opt_args(&datad); + len = (int) (datad-old); + g_free(old); + } /* send the text to custom functions to handle - skip arguments */ old = datad = cmd_get_callfuncs(data+len, &count, &args); @@ -392,7 +396,9 @@ char *cmd_get_params(const char *data, int count, ...) /* get rest */ arg = datad; } else { - arg = cmd_get_quoted_param(&datad); + arg = (count & PARAM_FLAG_NOQUOTES) ? + cmd_get_param(&datad) : + cmd_get_quoted_param(&datad); } str = (char **) va_arg(args, char **); |