diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-03-07 23:23:54 +0100 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-03-07 23:27:08 +0100 |
commit | 7bd1b80687cc97010094de0d398b429480e0a608 (patch) | |
tree | 9184432bcbb137b070bfecca650da5c981707f5e /src | |
parent | 7f4fd6037046ba1192bf9612c2cecd809d25b48e (diff) | |
download | irssi-7bd1b80687cc97010094de0d398b429480e0a608.zip |
fix dcc get
fixes #656
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/dcc/dcc-autoget.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/irc/dcc/dcc-autoget.c b/src/irc/dcc/dcc-autoget.c index de23a5d1..dd12f438 100644 --- a/src/irc/dcc/dcc-autoget.c +++ b/src/irc/dcc/dcc-autoget.c @@ -23,6 +23,7 @@ #include "masks.h" #include "settings.h" #include "servers.h" +#include "misc.h" #include "dcc-get.h" @@ -30,7 +31,7 @@ static void sig_dcc_request(GET_DCC_REC *dcc, const char *nickaddr) { struct stat statbuf; const char *masks; - char *str, *file; + char *str, *file, *esc_arg; int max_size; if (!IS_DCC_GET(dcc)) return; @@ -68,11 +69,13 @@ static void sig_dcc_request(GET_DCC_REC *dcc, const char *nickaddr) /* ok. but do we want/need to resume? */ file = dcc_get_download_path(dcc->arg); + esc_arg = escape_string(dcc->arg); str = g_strdup_printf(settings_get_bool("dcc_autoresume") && stat(file, &statbuf) == 0 ? - "RESUME %s %s" : "GET %s %s", - dcc->nick, dcc->arg); + "RESUME %s \"%s\"" : "GET %s \"%s\"", + dcc->nick, esc_arg); signal_emit("command dcc", 2, str, dcc->server); + g_free(esc_arg); g_free(file); g_free(str); } |