1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 00:33:13 +02:00

Fixed DCC bug: delete failed file only if really empty (on disk)

This commit is contained in:
Sebastien Helleu
2005-09-20 16:14:04 +00:00
parent 9c7d05f605
commit 25bbe3d284
4 changed files with 22 additions and 4 deletions
+2 -1
View File
@@ -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)
+9 -1
View File
@@ -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);
+2 -1
View File
@@ -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)
+9 -1
View File
@@ -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);