mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
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:
parent
f45e5aa3fc
commit
51dfbe0bc9
@ -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
|
||||||
|
12
src/file.c
12
src/file.c
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user