summaryrefslogtreecommitdiff
path: root/news/nn/patches/patch-az
blob: fca0780a7e0aeae3462b7af7b7e21906f5242035 (plain)
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
$NetBSD: patch-az,v 1.2 2006/10/14 19:33:45 schwarz Exp $

--- sort.c.orig	2005-03-30 21:24:35.000000000 +0200
+++ sort.c	2006-10-14 20:38:02.000000000 +0200
@@ -51,6 +51,29 @@
  *	before MATCH_?? (t, a, b) is used.
  */
 
+#ifdef HAVE_WORKING_COLLATE
+
+#ifdef HAVE_8BIT_CTYPE
+#define MATCH_DROP(table, c) !isprint(c)
+#else
+#define MATCH_DROP(table, c) ( c & 0200 || !isprint(c) )
+#endif
+#define MATCH_EQ(table, a, b) ( a == b || table(a, b) == 0 )
+#define MATCH_LS_EQ(table, a, b) ( a == b || table(a, b) <= 0 )
+#define MATCH_LS(table, a, b) ( table(a, b) < 0 )
+#define MATCH_CMP(table, a, b) table(a, b)
+
+static int match_subject(a, b)
+char a, b;
+{
+	static char aa[2], bb[2];
+
+	aa[0] = a; bb[0] = b;
+	return strcoll(aa, bb);
+}
+
+#else
+
 #define	MATCH_DROP(table, c) ( c & 0200 || table[c] == 0 )
 #define MATCH_EQ(table, a, b) ( a == b || table[a] == table[b] )
 #define MATCH_LS_EQ(table, a, b) ( a <= b || table[a] <= table[b] )
@@ -85,6 +108,7 @@
     26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 00, 00
 };
 
+#endif /* HAVE_WORKING_COLLATE */
 
 static int
 order_subj_date(article_header ** ah1, article_header ** ah2)