mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Return G_IO_ERROR_IS_DIRECTORY, not G_IO_ERROR_WOULD_MERGE when moving
2008-03-27 Alexander Larsson <alexl@redhat.com> * glocalfile.c (g_local_file_move): Return G_IO_ERROR_IS_DIRECTORY, not G_IO_ERROR_WOULD_MERGE when moving file over directory. This is according to the docs and what the move via copy+remove fallback does. svn path=/trunk/; revision=6758
This commit is contained in:
parent
d7d4211cb0
commit
9dfce3a26a
@ -1,3 +1,10 @@
|
||||
2008-03-27 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* glocalfile.c (g_local_file_move):
|
||||
Return G_IO_ERROR_IS_DIRECTORY, not G_IO_ERROR_WOULD_MERGE when moving
|
||||
file over directory. This is according to the docs and what the move via
|
||||
copy+remove fallback does.
|
||||
|
||||
2008-03-27 Lin Ma <Lin.Ma@Sun.COM>
|
||||
|
||||
* fen/*.[hc]: Updated copyright.
|
||||
|
@ -2078,9 +2078,8 @@ g_local_file_move (GFile *source,
|
||||
g_strerror (errsv));
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
source_is_dir = S_ISDIR (statbuf.st_mode);
|
||||
|
||||
source_is_dir = S_ISDIR (statbuf.st_mode);
|
||||
source_size = statbuf.st_size;
|
||||
|
||||
destination_exist = FALSE;
|
||||
@ -2094,10 +2093,16 @@ g_local_file_move (GFile *source,
|
||||
/* Always fail on dirs, even with overwrite */
|
||||
if (S_ISDIR (statbuf.st_mode))
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_WOULD_MERGE,
|
||||
_("Can't move directory over directory"));
|
||||
if (source_is_dir)
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_WOULD_MERGE,
|
||||
_("Can't move directory over directory"));
|
||||
else
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_IS_DIRECTORY,
|
||||
_("File is directory"));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user