diff --git a/ChangeLog b/ChangeLog index 89c95a8a3..f22a957cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2005-09-15 +ChangeLog - 2005-09-20 Version 0.1.5 (under dev!): + * fixed DCC bug: delete failed file only if really empty (on disk) * fixed IRC message parser bug * fixed scroll problem (screen moving when scrolling and new line displayed) diff --git a/src/irc/irc-dcc.c b/src/irc/irc-dcc.c index 443b97c22..630b39440 100644 --- a/src/irc/irc-dcc.c +++ b/src/irc/irc-dcc.c @@ -334,6 +334,7 @@ void dcc_close (t_irc_dcc *ptr_dcc, int status) { t_gui_buffer *ptr_buffer; + struct stat st; ptr_dcc->status = status; @@ -395,7 +396,14 @@ dcc_close (t_irc_dcc *ptr_dcc, int status) && DCC_IS_RECV(ptr_dcc->type) && ptr_dcc->local_filename && ptr_dcc->pos == 0) - unlink (ptr_dcc->local_filename); + { + /* erase file only if really empty on disk */ + if (stat (ptr_dcc->local_filename, &st) != -1) + { + if ((unsigned long) st.st_size == 0) + unlink (ptr_dcc->local_filename); + } + } if (DCC_IS_CHAT(ptr_dcc->type)) channel_remove_dcc (ptr_dcc); diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 89c95a8a3..f22a957cf 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2005-09-15 +ChangeLog - 2005-09-20 Version 0.1.5 (under dev!): + * fixed DCC bug: delete failed file only if really empty (on disk) * fixed IRC message parser bug * fixed scroll problem (screen moving when scrolling and new line displayed) diff --git a/weechat/src/irc/irc-dcc.c b/weechat/src/irc/irc-dcc.c index 443b97c22..630b39440 100644 --- a/weechat/src/irc/irc-dcc.c +++ b/weechat/src/irc/irc-dcc.c @@ -334,6 +334,7 @@ void dcc_close (t_irc_dcc *ptr_dcc, int status) { t_gui_buffer *ptr_buffer; + struct stat st; ptr_dcc->status = status; @@ -395,7 +396,14 @@ dcc_close (t_irc_dcc *ptr_dcc, int status) && DCC_IS_RECV(ptr_dcc->type) && ptr_dcc->local_filename && ptr_dcc->pos == 0) - unlink (ptr_dcc->local_filename); + { + /* erase file only if really empty on disk */ + if (stat (ptr_dcc->local_filename, &st) != -1) + { + if ((unsigned long) st.st_size == 0) + unlink (ptr_dcc->local_filename); + } + } if (DCC_IS_CHAT(ptr_dcc->type)) channel_remove_dcc (ptr_dcc);