summaryrefslogtreecommitdiff
path: root/src/irc/irc-dcc.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-08-05 19:33:48 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-08-05 19:33:48 +0000
commitfb607cb4abe142758e68062110fd1480d319d84a (patch)
tree8161d9aff1d0a93790f69b5ce0b8b122f8a38983 /src/irc/irc-dcc.c
parentb2183ee3edbfceb66a5705fcfc601c6e72728049 (diff)
downloadweechat-fb607cb4abe142758e68062110fd1480d319d84a.zip
Fixed DCC restore after /upgrade (now order is saved)
Diffstat (limited to 'src/irc/irc-dcc.c')
-rw-r--r--src/irc/irc-dcc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/irc/irc-dcc.c b/src/irc/irc-dcc.c
index 985c7160e..9c4d17893 100644
--- a/src/irc/irc-dcc.c
+++ b/src/irc/irc-dcc.c
@@ -50,6 +50,7 @@
t_irc_dcc *dcc_list = NULL; /* DCC files & chat list */
+t_irc_dcc *last_dcc = NULL; /* last DCC in list */
char *dcc_status_string[] = /* strings for DCC status */
{ N_("Waiting"), N_("Connecting"), N_("Active"), N_("Done"), N_("Failed"),
N_("Aborted") };
@@ -385,6 +386,8 @@ dcc_free (t_irc_dcc *ptr_dcc)
}
/* remove DCC from list */
+ if (last_dcc == ptr_dcc)
+ last_dcc = ptr_dcc->prev_dcc;
if (ptr_dcc->prev_dcc)
{
(ptr_dcc->prev_dcc)->next_dcc = ptr_dcc->next_dcc;
@@ -749,6 +752,8 @@ dcc_alloc ()
new_dcc->next_dcc = dcc_list;
if (dcc_list)
dcc_list->prev_dcc = new_dcc;
+ else
+ last_dcc = new_dcc;
dcc_list = new_dcc;
return new_dcc;