summaryrefslogtreecommitdiff
path: root/net/dictd/files/patch-break-utf8
blob: 33bf83184831225addc8884fca7aba89c7cdbf13 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
diff -ru ../dictd-freebsd/dictd.c ./dictd.c
--- ../dictd-freebsd/dictd.c	Sun Nov 24 09:35:55 2002
+++ ./dictd.c	Sun Dec  1 22:29:55 2002
@@ -662,6 +662,8 @@
 
 static void set_utf8_mode (const char *locale)
 {
+#include <osreldate.h>
+#if __FreeBSD_version > 499999
    char *locale_copy;
    locale_copy = strdup (locale);
    strlwr_8bit (locale_copy);
@@ -671,6 +673,9 @@
        strstr (locale_copy, "utf8");
 
    free (locale_copy);
+#else
+   utf8_mode = 0;
+#endif
 }
 
 static void init (const char *fn)
diff -ru ../dictd-freebsd/index.c ./index.c
--- ../dictd-freebsd/index.c	Sun Dec  1 22:12:49 2002
+++ ./index.c	Sun Dec  1 22:25:06 2002
@@ -111,6 +111,10 @@
    const char *src, char *dest,
    int allchars_mode)
 {
+#include <osreldate.h>
+#if __FreeBSD_version < 500000
+    abort();
+#else
     wint_t      ucs4_char;
 
     while (src && src [0]){
@@ -130,6 +134,7 @@
     *dest = 0;
 
     return (src != NULL);
+#endif
 }
 
 static void dict_table_init(void)
@@ -166,9 +171,11 @@
 	p[i]         = &s[2 * i];
     }
                                 /* Sort those strings in the locale */
+#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 */
@@ -1126,6 +1133,9 @@
 */
 static int stranagram_utf8 (char *str)
 {
+#if __FreeBSD_version < 500000
+    abort();
+#else
    size_t len;
    char *p;
 
@@ -1142,6 +1151,7 @@
 
    stranagram_8bit (str, -1);
    return 1;
+#endif
 }
 
 /* makes anagram of utf-8 string 'str' */
diff -ru ../dictd-freebsd/utf8_ucs4.c ./utf8_ucs4.c
--- ../dictd-freebsd/utf8_ucs4.c	Sun Nov 24 09:35:55 2002
+++ ./utf8_ucs4.c	Sun Dec  1 22:44:40 2002
@@ -1,3 +1,5 @@
+#include <osreldate.h>
+#if __FreeBSD_version > 499999
 #include <wctype.h>
 #include <stdlib.h>
 #include <ctype.h>
@@ -210,3 +212,4 @@
     else
 	return (size_t) -1;
 }
+#endif // __FreeBSD_version > 499999
diff -ru ../dictd-freebsd/utf8_ucs4.h ./utf8_ucs4.h
--- ../dictd-freebsd/utf8_ucs4.h	Sun Nov 24 09:35:55 2002
+++ ./utf8_ucs4.h	Sun Dec  1 22:26:15 2002
@@ -1,3 +1,5 @@
+#include <osreldate.h>
+#if __FreeBSD_version > 499999
 #ifndef _UTF8_UCS4_H_
 #define _UTF8_UCS4_H_
 
@@ -73,3 +75,4 @@
 __END_DECLS
 
 #endif // _UTF8_UCS4_H_
+#endif // __FreeBSD_version > 499999