Репозитории ALT
S: | 2.24.4-alt12 |
5.1: | 2.24.4-alt0.M50P.1 |
4.1: | 2.22.0-alt1.1 |
4.0: | 2.16.3-alt3 |
3.0: | 1.0.5-alt7.1 |
Группа :: Система/Библиотеки
Пакет: gnome-vfs
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: gnome-vfs-1.0.5-charset-and-rpmsave.patch
Скачать
Скачать
--- gnome-vfs-1.0.5/modules/desktop-method.c.charset-and-rpmsave Fri Sep 21 17:12:23 2001
+++ gnome-vfs-1.0.5/modules/desktop-method.c Thu Apr 11 11:44:42 2002
@@ -288,6 +288,33 @@
return result;
}
+
+static gboolean
+str_has_suffix (const char *haystack, const char *needle)
+{
+ const char *h, *n;
+
+ if (needle == NULL) {
+ return TRUE;
+ }
+ if (haystack == NULL) {
+ return needle[0] == '\0';
+ }
+
+ /* Eat one character at a time. */
+ h = haystack + strlen(haystack);
+ n = needle + strlen(needle);
+ do {
+ if (n == needle) {
+ return TRUE;
+ }
+ if (h == haystack) {
+ return FALSE;
+ }
+ } while (*--h == *--n);
+ return FALSE;
+}
+
static GnomeVFSResult
do_read_directory (GnomeVFSMethod *method,
GnomeVFSMethodHandle *method_handle,
@@ -319,7 +346,29 @@
else
return result;
} else {
- return GNOME_VFS_OK;
+ /* Filter everything except subdirs, .directory, and .desktop files */
+ if ((file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) &&
+ (file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY))
+ return GNOME_VFS_OK;
+ if ((file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) &&
+ (file_info->type != GNOME_VFS_FILE_TYPE_REGULAR)) {
+ dh->next = dh->next->next;
+ if (dh->next)
+ goto next;
+ else
+ return GNOME_VFS_ERROR_EOF;
+ } else if (strcmp (file_info->name, ".directory") == 0) {
+ return GNOME_VFS_OK;
+ } else if (str_has_suffix (file_info->name, ".desktop")) {
+ return GNOME_VFS_OK;
+ } else {
+
+ dh->next = dh->next->next;
+ if (dh->next)
+ goto next;
+ else
+ return GNOME_VFS_ERROR_EOF;
+ }
}
}
--- gnome-vfs-1.0.5/libgnomevfs/gnome-vfs-mime-info.c.charset-and-rpmsave Thu Mar 14 22:33:01 2002
+++ gnome-vfs-1.0.5/libgnomevfs/gnome-vfs-mime-info.c Thu Apr 11 11:44:42 2002
@@ -406,7 +406,7 @@
if (converter == (iconv_t)-1) {
if (already_warned != TRUE) {
already_warned = TRUE;
- g_warning ("Unable to convert MIME info from UTF-8 to the current locale %s. MIME info will probably display wrong.", charset);
+ g_warning ("Unable to convert MIME info from UTF-8 to the current charset %s. MIME info will probably display wrong: %s", charset, strerror (errno));
}
return g_strdup (utf8string);
}
@@ -418,7 +418,7 @@
iconv_close (converter);
if (converted == NULL) {
- g_warning ("Unable to convert %s from UTF-8 to %s, this string will probably display wrong.", utf8string, charset);
+ g_warning ("Unable to convert %s from UTF-8 to %s, this string will probably display wrong: %s", utf8string, charset, strerror (errno));
return g_strdup (utf8string);
}
}