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:
@@ -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
@@ -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
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user