From 65c9a361aba0a1b11ccf8e651522e0b0f94a8710 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 19 Nov 2001 02:46:26 +0000 Subject: [PATCH] If /SET dcc_upload_path is empty, we should use the current directory, not root directory. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2074 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/dcc/fe-dcc-send.c | 8 ++++++-- src/irc/dcc/dcc-send.c | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fe-common/irc/dcc/fe-dcc-send.c b/src/fe-common/irc/dcc/fe-dcc-send.c index ecaa3f68..6ec49ed8 100644 --- a/src/fe-common/irc/dcc/fe-dcc-send.c +++ b/src/fe-common/irc/dcc/fe-dcc-send.c @@ -113,9 +113,13 @@ static void sig_dcc_send_complete(GList **list, WINDOW_REC *window, return; /* completing filename parameter for /DCC SEND */ - path = convert_home(settings_get_str("dcc_upload_path")); + path = convert_home(settings_get_str("dcc_upload_path")); + if (*path == '\0') { + /* use the default path */ + g_free_and_null(path); + } + *list = filename_complete(word, path); - g_free(path); if (*list != NULL) { *want_space = FALSE; diff --git a/src/irc/dcc/dcc-send.c b/src/irc/dcc/dcc-send.c index 4b5943ad..9d312e13 100644 --- a/src/irc/dcc/dcc-send.c +++ b/src/irc/dcc/dcc-send.c @@ -155,7 +155,8 @@ static char *dcc_send_get_file(const char *fname) g_free(str); path = convert_home(settings_get_str("dcc_upload_path")); - str = g_strconcat(path, G_DIR_SEPARATOR_S, fname, NULL); + str = *path == '\0' ? g_strdup(fname) : + g_strconcat(path, G_DIR_SEPARATOR_S, fname, NULL); g_free(path); }