[nautilus] file-operations: don't mix character and byte lengths



commit 0531db12b0a929fca139a3fde0846d31b602d922
Author: Abderrahim Kitouni <a kitouni gmail com>
Date:   Sat Mar 24 19:07:20 2012 +0100

    file-operations: don't mix character and byte lengths
    
    Otherwise untitled files end up with a (possibly) corrupt part of the
    name appended.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672761

 libnautilus-private/nautilus-file-operations.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index 377494e..4c4ac87 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -6045,7 +6045,7 @@ create_job (GIOSchedulerJob *io_job,
 				new_filename = g_strdup (filename);
 			} else {
 				filename_base = eel_filename_strip_extension (filename);
-				offset = g_utf8_strlen (filename_base, -1);
+				offset = strlen (filename_base);
 				suffix = g_strdup (filename + offset);
 
 				filename2 = g_strdup_printf ("%s %d%s", filename_base, count, suffix);
@@ -6082,7 +6082,7 @@ create_job (GIOSchedulerJob *io_job,
 			g_object_unref (dest);
 			dest = NULL;
 			filename_base = eel_filename_strip_extension (filename);
-			offset = g_utf8_strlen (filename_base, -1);
+			offset = strlen (filename_base);
 			suffix = g_strdup (filename + offset);
 
 			filename2 = g_strdup_printf ("%s %d%s", filename_base, ++count, suffix);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]