1
1

* file.c (copy_dir_dir): Check the destination is a directory

if it exists. Reported by Thomas <metaf4@pseudonym.org>.
Этот коммит содержится в:
Andrew V. Samoilov 2002-01-15 08:01:29 +00:00
родитель 1e5b1bfde1
Коммит 7d88c34470
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -1,7 +1,12 @@
2002-01-15 Andrew V. Samoilov <kai@cmail.ru>
* file.c (copy_dir_dir): Check the destination is a directory
if it exists. Reported by Thomas <metaf4@pseudonym.org>.
2002-01-09 Andrew V. Samoilov <kai@cmail.ru>
* util.c (string_perm) [S_IFDOOR]: Support Solaris doors.
screen.c (string_file_type) [S_IFDOOR]: Likewise.
* screen.c (string_file_type) [S_IFDOOR]: Likewise.
2001-12-21 Pavel Roskin <proski@gnu.org>
@ -126,7 +131,7 @@
2001-10-26 Andrew V. Samoilov <kai@cmail.ru>
* key.c (push_char): Fix buffer length calculation.
By drk@sgi.com.
By David Kaelbling <drk@sgi.com>.
http://bugzilla.gnome.org/show_bug.cgi?id=60932
(define_sequence): Likewise.

Просмотреть файл

@ -886,6 +886,7 @@ copy_dir_dir (FileOpContext *ctx, char *s, char *d, int toplevel,
lp->next = parent_dirs;
parent_dirs = lp;
retry_dst_stat:
/* Now, check if the dest dir exists, if not, create it. */
if (mc_stat (d, &buf)){
/* Here the dir doesn't exist : make it !*/
@ -906,6 +907,13 @@ copy_dir_dir (FileOpContext *ctx, char *s, char *d, int toplevel,
* so, say /bla exists, if we copy /tmp/\* to /bla, we get /bla/tmp/\*
* or ( /bla doesn't exist ) /tmp/\* to /bla -> /bla/\*
*/
if (!S_ISDIR (buf.st_mode)){
return_status = file_error (_(" Destination \"%s\" must be a directory \n %s "), d);
if (return_status == FILE_RETRY)
goto retry_dst_stat;
g_free (parent_dirs);
return return_status;
}
#if 1
/* Again, I'm getting curious. Is not d already what we wanted, incl.
* masked source basename? Is not this just a relict of the past versions?