summaryrefslogtreecommitdiff
path: root/net/dictd/files/patch-break-utf8
blob: a1a30e1d431c48a77ab46bd6912aa6523b3f5233 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- dictd.c.orig	Mon Mar 10 01:07:36 2003
+++ dictd.c	Fri Oct 10 00:19:17 2003
@@ -1064,6 +1064,8 @@
 
 static void set_utf8bit_mode (const char *loc)
 {
+#include <osreldate.h>
+#if __FreeBSD_version > 499999
    char *locale_copy;
    locale_copy = strdup (loc);
    strlwr_8bit (locale_copy);
@@ -1075,6 +1077,9 @@
    bit8_mode = !utf8_mode && (locale_copy [0] != 'c' || locale_copy [1] != 0);
 
    free (locale_copy);
+#else
+   utf8_mode = 0;
+#endif
 }
 
 static void init (const char *fn)
--- index.c.orig	Mon Jan 26 02:52:14 2004
+++ index.c	Mon Jan 26 03:02:18 2004
@@ -144,9 +144,12 @@
       p[i]         = &s[2 * i];
    }
                                 /* Sort those strings in the locale */
+#include <osreldate.h>
+#if __FreeBSD_version > 499999
    if (utf8_mode)
       qsort(p, UCHAR_MAX + 1, sizeof(p[0]), dict_table_init_compare_utf8);
    else
+#endif
       qsort(p, UCHAR_MAX + 1, sizeof(p[0]), dict_table_init_compare_strcoll);
 
                                 /* Extract our unordered arrays */
@@ -1245,6 +1248,9 @@
 */
 static int stranagram_utf8 (char *str)
 {
+#if __FreeBSD_version < 500000
+    abort();
+#else
    size_t len;
    char   *p;
 
@@ -1267,6 +1273,7 @@
 
    stranagram_8bit (str, -1);
    return 1;
+#endif
 }
 #endif