diff options
author | louipc | 2021-02-21 18:09:59 -0500 |
---|---|---|
committer | louipc | 2021-02-21 18:37:46 -0500 |
commit | 646de032e82bd8c63e4adb79508b2013871a5162 (patch) | |
tree | 986099a102bfea81f9e3ff40d06b97aa4df523f2 /compare-in-utf-8.diff | |
parent | fd54ad0f7581574d7b4827c4f4b20022c6382087 (diff) | |
download | aur-646de032e82bd8c63e4adb79508b2013871a5162.tar.gz |
v014
Drop all old patches, new (annoying) dependency
Signed-off-by: louipc <louipc@gmx.com>
Diffstat (limited to 'compare-in-utf-8.diff')
-rw-r--r-- | compare-in-utf-8.diff | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/compare-in-utf-8.diff b/compare-in-utf-8.diff deleted file mode 100644 index 2b65b178460d..000000000000 --- a/compare-in-utf-8.diff +++ /dev/null @@ -1,115 +0,0 @@ -Correctly order the names in the index when they contain UTF-8 -characters. Use libunac for converting the accented characters in -UTF-8 into plain ASCII. - - -- Rafael Laboissiere <rafael@debian.org> Sat, 21 Feb 2009 19:18:36 +0100 - ---- a/configure.ac -+++ b/configure.ac -@@ -22,6 +22,10 @@ - LIBS="$LIBS $(pkg-config glib-2.0 --libs)" - CFLAGS="$CFLAGS $(pkg-config glib-2.0 --cflags)" - -+# Libunac settings -+LIBS="$LIBS $(pkg-config unac --libs)" -+CFLAGS="$CFLAGS $(pkg-config unac --cflags)" -+ - # Checks for header files. - AC_HEADER_STDC - ---- a/src/entry.c -+++ b/src/entry.c -@@ -25,6 +25,7 @@ - #include <string.h> - #include <vc.h> - #include <glib/gunicode.h> -+#include <unac.h> - - #define MENU_PRINT_FORMAT_SIZE 80 - -@@ -175,15 +176,43 @@ - entry_node **ena = NULL; - entry_node **enb = NULL; - -+ char* ena_desc = NULL; -+ char* enb_desc = NULL; -+ char* pure_a = NULL; -+ char* pure_b = NULL; -+ int length[1] = {0}; -+ int a_alloc = 1; -+ int b_alloc = 1; -+ - ena = (entry_node **) a; - enb = (entry_node **) b; - -- ret_val = cmp_given_n ((*ena)->description, (*enb)->description); -+ ena_desc = (*ena)->description; -+ enb_desc = (*enb)->description; -+ -+ /* Try to convert the strings from UTF-8 and fall back to the original -+ strings if it fails */ -+ if (unac_string ("UTF-8", ena_desc, strlen (ena_desc), &pure_a, length)) { -+ pure_a = ena_desc; -+ a_alloc = 0; -+ } -+ -+ if (unac_string ("UTF-8", enb_desc, strlen (enb_desc), &pure_b, length)) { -+ pure_b = enb_desc; -+ b_alloc = 0; -+ } -+ -+ ret_val = cmp_given_n (pure_a, pure_b); - if (0 == ret_val) - { -- ret_val = strcmp ((*ena)->description, (*enb)->description); -+ ret_val = strcmp (pure_a, pure_b); - } - -+ if (a_alloc) -+ free (pure_a); -+ if (b_alloc) -+ free (pure_b); -+ - return ret_val; - } - -@@ -197,10 +226,38 @@ - entry_node **ena = NULL; - entry_node **enb = NULL; - -+ char* ena_desc = NULL; -+ char* enb_desc = NULL; -+ char* pure_a = NULL; -+ char* pure_b = NULL; -+ int length[1] = {0}; -+ int a_alloc = 1; -+ int b_alloc = 1; -+ - ena = (entry_node **) a; - enb = (entry_node **) b; - -- ret_val = strcmp ((*ena)->description, (*enb)->description); -+ ena_desc = (*ena)->description; -+ enb_desc = (*enb)->description; -+ -+ /* Try to convert the strings from UTF-8 and fall back to the original -+ strings if it fails */ -+ if (unac_string ("UTF-8", ena_desc, strlen (ena_desc), &pure_a, length)) { -+ pure_a = ena_desc; -+ a_alloc = 0; -+ } -+ -+ if (unac_string ("UTF-8", enb_desc, strlen (enb_desc), &pure_b, length)) { -+ pure_b = enb_desc; -+ b_alloc = 0; -+ } -+ -+ ret_val = strcmp (pure_a, pure_b); -+ -+ if (a_alloc) -+ free (pure_a); -+ if (b_alloc) -+ free (pure_b); - - return ret_val; - } |