1998-09-14 Norbert Warmuth <k3190@fh-sw.de>

* file.c (move_dir_dir): Fixed severe bug reported by Andrew Pechenov
<zx80@demo.ru> (losing files when moving directories cross filesystem
boundaries): make sure erase_list is emptied always not only when we
deleted files.
This commit is contained in:
Norbert Warmuth 1998-09-13 23:40:09 +00:00
parent f45e5aa3fc
commit 51dfbe0bc9
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,10 @@
1998-09-14 Norbert Warmuth <k3190@fh-sw.de>
* file.c (move_dir_dir): Fixed severe bug reported by Andrew Pechenov
<zx80@demo.ru> (losing files when moving directories cross filesystem
boundaries): make sure erase_list is emptied always not only when we
deleted files.
Sat Sep 12 02:59:43 1998 Timur Bakeyev <mc@bat.ru> Sat Sep 12 02:59:43 1998 Timur Bakeyev <mc@bat.ru>
* screen.c: Xtry_to_select() Remove extfs hack to the main.c. Change * screen.c: Xtry_to_select() Remove extfs hack to the main.c. Change

View File

@ -1630,6 +1630,7 @@ int
move_dir_dir (char *s, char *d) move_dir_dir (char *s, char *d)
{ {
struct stat sbuf, dbuf, destbuf; struct stat sbuf, dbuf, destbuf;
struct link *lp;
char *destdir; char *destdir;
int return_status; int return_status;
int move_over = 0; int move_over = 0;
@ -1700,7 +1701,6 @@ oktoret:
mc_refresh (); mc_refresh ();
if (erase_at_end) { if (erase_at_end) {
struct link *lp;
for ( ; erase_list && return_status != FILE_ABORT; ) { for ( ; erase_list && return_status != FILE_ABORT; ) {
if (S_ISDIR (erase_list->st_mode)) { if (S_ISDIR (erase_list->st_mode)) {
return_status = erase_dir_iff_empty (erase_list->name); return_status = erase_dir_iff_empty (erase_list->name);
@ -1710,16 +1710,16 @@ oktoret:
erase_list = erase_list->next; erase_list = erase_list->next;
free (lp); free (lp);
} }
for ( ; erase_list; ) {
lp = erase_list;
erase_list = erase_list->next;
free (lp);
}
} }
erase_dir_iff_empty (s); erase_dir_iff_empty (s);
ret: ret:
free (destdir); free (destdir);
for ( ; erase_list; ) {
lp = erase_list;
erase_list = erase_list->next;
free (lp);
}
return return_status; return return_status;
} }