[evince] comics: Sort pages in natural order
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] comics: Sort pages in natural order
- Date: Mon, 3 Oct 2016 15:43:44 +0000 (UTC)
commit 3977c033b538a2a6a25214d1a4891b40dfebcae6
Author: Felipe Borges <felipeborges gnome org>
Date: Fri Sep 9 16:57:00 2016 +0200
comics: Sort pages in natural order
Evince was sorting pages in lexicographic order. In doing so, often
files named page1, page2, ..., page9, page10, ... to be sorted as
page1, page10, ..., page2.
https://bugzilla.gnome.org/show_bug.cgi?id=770695
backend/comics/comics-document.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c
index 845f517..3fbd632 100644
--- a/backend/comics/comics-document.c
+++ b/backend/comics/comics-document.c
@@ -20,6 +20,7 @@
#include <config.h>
+#define _GNU_SOURCE
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
@@ -466,7 +467,7 @@ static int
sort_page_names (gconstpointer a,
gconstpointer b)
{
- return strcmp (* (const char **) a, * (const char **) b);
+ return strverscmp (* (const char **) a, * (const char **) b);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]