Mercurial > gftp.yaz
diff src/gtk/transfer.c @ 770:eeb471438232
2006-7-19 Brian Masney <masneyb@gftp.org>
* src/gtk/transfer.c (remove_file) - fixes for when the viewed file can
be removed if an invalid program is specified (closes #330182)
author | masneyb |
---|---|
date | Thu, 20 Jul 2006 01:28:53 +0000 |
parents | 49cfbe02926b |
children | cf2a51deefd8 |
line wrap: on
line diff
--- a/src/gtk/transfer.c Thu Jul 20 01:20:58 2006 +0000 +++ b/src/gtk/transfer.c Thu Jul 20 01:28:53 2006 +0000 @@ -254,14 +254,17 @@ static void -remove_file (char *filename) +remove_file (gftp_viewedit_data * ve_proc) { - if (unlink (filename) == 0) + if (ve_proc->remote_filename == NULL) + return; + + if (unlink (ve_proc->filename) == 0) ftp_log (gftp_logging_misc, NULL, _("Successfully removed %s\n"), - filename); + ve_proc->filename); else ftp_log (gftp_logging_error, NULL, - _("Error: Could not remove file %s: %s\n"), filename, + _("Error: Could not remove file %s: %s\n"), ve_proc->filename, g_strerror (errno)); } @@ -287,7 +290,7 @@ static void dont_upload (gftp_viewedit_data * ve_proc, gftp_dialog_data * ddata) { - remove_file (ve_proc->filename); + remove_file (ve_proc); free_edit_data (ve_proc); } @@ -350,7 +353,7 @@ ftp_log (gftp_logging_error, NULL, _("Error: Child %d returned %d\n"), pid, procret); if (ve_proc->view) - remove_file (ve_proc->filename); + remove_file (ve_proc); continue; } else @@ -376,7 +379,7 @@ ftp_log (gftp_logging_misc, NULL, _("File %s was not changed\n"), ve_proc->filename); - remove_file (ve_proc->filename); + remove_file (ve_proc); } else {