MythologyAge 发表于 2003-10-25 21:22:01

后缀名为patch的文件怎么用阿?

该文件源码如下:
diff -u nautilus-2.4.1/libnautilus-private/nautilus-file.c nautilus-2.4.1-locale/libnautilus-private/nautilus-file.c
--- nautilus-2.4.1/libnautilus-private/nautilus-file.c        2003-09-19 19:28:07.000000000 +0800
+++ nautilus-2.4.1-locale/libnautilus-private/nautilus-file.c        2003-10-22 14:11:09.000000000 +0800
@@ -2407,20 +2407,21 @@
                       * thing with any local filename that does not
                       * validate as good UTF-8.
                       */
-                        if (has_local_path (file)) {
-                                broken_filenames = have_broken_filenames ();
-                                if (broken_filenames || !g_utf8_validate (name, -1, NULL)) {
-                                        utf8_name = g_locale_to_utf8 (name, -1, NULL, NULL, NULL);
-                                        if (utf8_name != NULL) {
-                                                g_free (name);
-                                                name = utf8_name;
-                                                /* Guaranteed to be correct utf8 here */
-                                                validated = TRUE;
-                                        }
-                                } else if (!broken_filenames) {
-                                        /* name was valid, no need to re-validate */
+                        broken_filenames = have_broken_filenames ();
+                        if (broken_filenames || !g_utf8_validate (name, -1, NULL)) {
+                                utf8_name = g_locale_to_utf8 (name, -1, NULL, NULL, NULL);
+                                if (utf8_name != NULL) {
+                                        g_free (name);
+                                        name = utf8_name;
+                                        /* Guaranteed to be correct utf8 here */
                                        validated = TRUE;
                                }
+                        } else if (!broken_filenames) {
+                                /* name was valid, no need to re-validate */
+                                validated = TRUE;
+                        }
+
+                        if (has_local_path (file)) {
                        } else if (strcmp (name, "/") == 0) {
                                /* Special-case the display name for roots that are not local files */
                                g_free (name);
diff -u nautilus-2.4.1/libnautilus-private/nautilus-file-operations-progress.c nautilus-2.4.1-locale/libnautilus-private/nautilus-file-operations-progress.c
--- nautilus-2.4.1/libnautilus-private/nautilus-file-operations-progress.c        2003-02-28 23:14:57.000000000 +0800
+++ nautilus-2.4.1-locale/libnautilus-private/nautilus-file-operations-progress.c        2003-10-22 16:39:01.000000000 +0800
@@ -162,8 +162,19 @@
                return;
        }
       
+        printf("text: %s ", text);
        unescaped_text = gnome_vfs_unescape_string_for_display (text);
+        printf("unescaped: %s ", unescaped_text);
+        if (!g_utf8_validate(unescaped_text, -1, NULL)) {
+                char *convert;
+                convert = g_locale_to_utf8 (unescaped_text, -1, NULL, NULL, NULL);
+                if (convert != NULL) {
+                        g_free (unescaped_text);
+                        unescaped_text = convert;
+                }
+        }
        unescaped_utf8 = eel_make_valid_utf8 (unescaped_text);
+        printf("utf8: %s\n\r", unescaped_utf8);
        eel_ellipsizing_label_set_text (label, unescaped_utf8);
        g_free (unescaped_utf8);
        g_free (unescaped_text);

mozilla 发表于 2003-10-26 16:45:06

源码补丁文件,用来给源码打补丁

MythologyAge 发表于 2003-10-27 21:43:46

能不能具体讲一下,我是新手上路,谢谢拉
页: [1]
查看完整版本: 后缀名为patch的文件怎么用阿?