summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-gfx/geeqie/files/geeqie-1.0-filedata_compare.patch')
-rw-r--r--media-gfx/geeqie/files/geeqie-1.0-filedata_compare.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/media-gfx/geeqie/files/geeqie-1.0-filedata_compare.patch b/media-gfx/geeqie/files/geeqie-1.0-filedata_compare.patch
new file mode 100644
index 000000000000..50a1c0f8ac88
--- /dev/null
+++ b/media-gfx/geeqie/files/geeqie-1.0-filedata_compare.patch
@@ -0,0 +1,53 @@
+From 18d80ca385e38b3bf9bc4ef36264bb4d430aa1f6 Mon Sep 17 00:00:00 2001
+From: Vladimir Nadvornik <nadvornik@suse.cz>
+Date: Fri, 30 Sep 2011 23:57:31 +0200
+Subject: [PATCH] fixed filelist_sort_compare_filedata to not return 0 no different files
+
+---
+ src/filedata.c | 15 ++++++++++++---
+ 1 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/src/filedata.c b/src/filedata.c
+index f6e3896..78fd74e 100644
+--- a/src/filedata.c
++++ b/src/filedata.c
+@@ -852,6 +852,7 @@ static gboolean filelist_sort_ascend = TRUE;
+
+ gint filelist_sort_compare_filedata(FileData *fa, FileData *fb)
+ {
++ gint ret;
+ if (!filelist_sort_ascend)
+ {
+ FileData *tmp = fa;
+@@ -875,7 +876,8 @@ gint filelist_sort_compare_filedata(FileData *fa, FileData *fb)
+ break;
+ #ifdef HAVE_STRVERSCMP
+ case SORT_NUMBER:
+- return strverscmp(fa->name, fb->name);
++ ret = strverscmp(fa->name, fb->name);
++ if (ret != 0) return ret;
+ break;
+ #endif
+ default:
+@@ -883,9 +885,16 @@ gint filelist_sort_compare_filedata(FileData *fa, FileData *fb)
+ }
+
+ if (options->file_sort.case_sensitive)
+- return strcmp(fa->collate_key_name, fb->collate_key_name);
++ ret = strcmp(fa->collate_key_name, fb->collate_key_name);
+ else
+- return strcmp(fa->collate_key_name_nocase, fb->collate_key_name_nocase);
++ ret = strcmp(fa->collate_key_name_nocase, fb->collate_key_name_nocase);
++
++ if (ret != 0) return ret;
++
++ /* do not return 0 unless the files are really the same
++ file_data_pool ensures that original_path is unique
++ */
++ return strcmp(fa->original_path, fb->original_path);
+ }
+
+ gint filelist_sort_compare_filedata_full(FileData *fa, FileData *fb, SortType method, gboolean ascend)
+--
+1.6.1
+