[patch] symlink filename i18n



Hi,

Could you review the patch to enable none UTF-8 symlinks?
http://bugzilla.gnome.org/show_bug.cgi?id=331379

Thanks,
fujiwara
--- nautilus-2.6.1-orig/libnautilus-private/nautilus-file-operations.c	2006-02-27 14:52:01.058031000 +0900
+++ nautilus-2.6.1/libnautilus-private/nautilus-file-operations.c	2006-02-27 16:47:32.936614000 +0900
@@ -1114,7 +1114,7 @@ static char *
 get_link_name (char *name, int count) 
 {
 	char *result;
-	char *unescaped_name;
+	char *unescaped_name = NULL;
 	char *unescaped_tmp_name;
 	char *unescaped_result;
 	char *new_file;
@@ -1126,8 +1126,9 @@ get_link_name (char *name, int count) 
 	unescaped_tmp_name = gnome_vfs_unescape_string (name, "/");
 	g_free (name);
 
-	unescaped_name = g_filename_to_utf8 (unescaped_tmp_name, -1,
-					     NULL, NULL, NULL);
+	if (!nautilus_have_broken_filenames ())
+		unescaped_name = g_filename_to_utf8 (unescaped_tmp_name, -1,
+		                                     NULL, NULL, NULL);
 	if (!unescaped_name)
 		unescaped_name = g_locale_to_utf8 (unescaped_tmp_name, -1,
 					     NULL, NULL, NULL);
@@ -1476,7 +1477,7 @@ get_duplicate_name (const char *name, in
 static char *
 get_next_duplicate_name (char *name, int count_increment)
 {
-	char *unescaped_name;
+	char *unescaped_name = NULL;
 	char *unescaped_tmp_name;
 	char *unescaped_result;
 	char *result;
@@ -1485,8 +1486,9 @@ get_next_duplicate_name (char *name, int
 	unescaped_tmp_name = gnome_vfs_unescape_string (name, "/");
 	g_free (name);
 
-	unescaped_name = g_filename_to_utf8 (unescaped_tmp_name, -1,
-					     NULL, NULL, NULL);
+	if (!nautilus_have_broken_filenames ())
+		unescaped_name = g_filename_to_utf8 (unescaped_tmp_name, -1,
+		                                     NULL, NULL, NULL);
 	if (!unescaped_name)
 		unescaped_name = g_locale_to_utf8 (unescaped_tmp_name, -1,
 					     NULL, NULL, NULL);


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