diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2016-04-05 22:39:54 +0200 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2016-04-05 22:39:54 +0200 |
commit | 1349755bb57a5f1f3a101b3382b550da50854957 (patch) | |
tree | 8be6a8deda7a54ebcd81c56f2f11f5c3c54284ab /src/irc | |
parent | 26f875263ab940751528b2c80429a33d059c6c6b (diff) | |
parent | be93c8d5bee1b923faa63e13957764e3f06e2ded (diff) | |
download | irssi-1349755bb57a5f1f3a101b3382b550da50854957.zip |
Merge pull request #453 from LemonBoy/dcc-quote
Support quoted filenames in some /DCC commands
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/dcc/dcc-get.c | 8 | ||||
-rw-r--r-- | src/irc/dcc/dcc.c | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/irc/dcc/dcc-get.c b/src/irc/dcc/dcc-get.c index a8b1c967..ac281683 100644 --- a/src/irc/dcc/dcc-get.c +++ b/src/irc/dcc/dcc-get.c @@ -526,14 +526,14 @@ void cmd_dcc_receive(const char *data, DCC_GET_FUNC accept_func, { GET_DCC_REC *dcc; GSList *tmp, *next; - char *nick, *fname; + char *nick, *arg, *fname; void *free_arg; int found; g_return_if_fail(data != NULL); - if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, - &nick, &fname)) + if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | + PARAM_FLAG_STRIP_TRAILING_WS, &nick, &arg)) return; if (*nick == '\0') { @@ -548,6 +548,8 @@ void cmd_dcc_receive(const char *data, DCC_GET_FUNC accept_func, return; } + fname = cmd_get_quoted_param(&arg); + found = FALSE; for (tmp = dcc_conns; tmp != NULL; tmp = next) { GET_DCC_REC *dcc = tmp->data; diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c index 17f6c477..c51f7c7a 100644 --- a/src/irc/dcc/dcc.c +++ b/src/irc/dcc/dcc.c @@ -490,7 +490,7 @@ static void event_no_such_nick(IRC_SERVER_REC *server, char *data) static void cmd_dcc_close(char *data, IRC_SERVER_REC *server) { GSList *tmp, *next; - char *typestr, *nick, *arg; + char *typestr, *nick, *arg, *fname; void *free_arg; int found, type; @@ -510,13 +510,15 @@ static void cmd_dcc_close(char *data, IRC_SERVER_REC *server) return; } + fname = cmd_get_quoted_param(&arg); + found = FALSE; for (tmp = dcc_conns; tmp != NULL; tmp = next) { DCC_REC *dcc = tmp->data; next = tmp->next; if (dcc->type == type && g_ascii_strcasecmp(dcc->nick, nick) == 0 && - (*arg == '\0' || g_strcmp0(dcc->arg, arg) == 0)) { + (*fname == '\0' || g_strcmp0(dcc->arg, fname) == 0)) { dcc_reject(dcc, server); found = TRUE; } |