Bug 548163 – Nautilus displays wrong error message for too long file

2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 548163 – Nautilus displays wrong error message for too long file
        names

        * glocalfile.c (g_local_file_set_display_name): Correctly set
        error conditions if the new name is e.g. too long. Reported
        by Leonardo Ferreira Fontenelle.


svn path=/branches/glib-2-18/; revision=7697
This commit is contained in:
Matthias Clasen 2008-11-28 08:07:35 +00:00 committed by Matthias Clasen
parent 3243c6a652
commit 4f6096cdc3
2 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,14 @@
2008-11-28 Matthias Clasen <mclasen@redhat.com>
Merged from trunk:
Bug 548163 Nautilus displays wrong error message for too long file
names
* glocalfile.c (g_local_file_set_display_name): Correctly set
error conditions if the new name is e.g. too long. Reported
by Leonardo Ferreira Fontenelle.
2008-11-28 Matthias Clasen <mclasen@redhat.com>
Merged from trunk:

View File

@ -1120,8 +1120,20 @@ g_local_file_set_display_name (GFile *file,
local = G_LOCAL_FILE (file);
new_local = G_LOCAL_FILE (new_file);
if (!(g_lstat (new_local->filename, &statbuf) == -1 &&
errno == ENOENT))
if (g_lstat (new_local->filename, &statbuf) == -1)
{
errsv = errno;
if (errsv != ENOENT)
{
g_set_error (error, G_IO_ERROR,
g_io_error_from_errno (errsv),
_("Error renaming file: %s"),
g_strerror (errsv));
return NULL;
}
}
else
{
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_EXISTS,