From d4d876846e62b613a1e5b80519e4a9a49eb905dc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 28 Nov 2008 08:05:49 +0000 Subject: [PATCH] =?utf8?q?=20=20=20=20=20=20=20=20Bug=20548163=20=E2=80=93?= =?utf8?q?=20Nautilus=20displays=20wrong=20error=20message=20for=20too=20l?= =?utf8?q?ong=20file=20=20=20=20=20=20=20=20=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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=/trunk/; revision=7696 --- gio/ChangeLog | 9 +++++++++ gio/glocalfile.c | 17 ++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index e3bd9b60..bbb87a06 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,12 @@ +2008-11-28 Matthias Clasen + + 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 Bug 547481 – g_data_input_stream_read_line behaves not as stated in diff --git a/gio/glocalfile.c b/gio/glocalfile.c index fb890db6..4d772b46 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -1116,12 +1116,23 @@ g_local_file_set_display_name (GFile *file, if (new_file == NULL) return NULL; - 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, -- 2.34.1