2003-10-21 00:24:34 +02:00
|
|
|
$NetBSD: patch-ac,v 1.2 2003/10/20 22:24:34 kristerw Exp $
|
2002-10-06 16:51:27 +02:00
|
|
|
|
2003-10-21 00:24:34 +02:00
|
|
|
--- src/kakasi.c.orig Sun Sep 2 13:43:21 2001
|
|
|
|
+++ src/kakasi.c Tue Oct 21 00:11:03 2003
|
2002-10-06 16:51:27 +02:00
|
|
|
@@ -41,6 +41,9 @@
|
|
|
|
#ifdef HAVE_MALLOC_H
|
|
|
|
# include <malloc.h>
|
|
|
|
#endif
|
|
|
|
+#ifdef HAVE_STRING_H
|
|
|
|
+# include <string.h>
|
|
|
|
+#endif
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "kakasi.h"
|
|
|
|
#ifdef LIBRARY
|
2003-10-21 00:24:34 +02:00
|
|
|
@@ -105,6 +108,12 @@
|
|
|
|
static int digest PARAMS((Character *c, int clen, Character *r, int rlen, int type, int (*proc)(void)));
|
|
|
|
static void digest_shift PARAMS((Character *c, int s));
|
|
|
|
#else /* LIBRARY */
|
|
|
|
+void digest_start_copy PARAMS((Character *c, Character *r));
|
|
|
|
+void put_separator PARAMS((void));
|
|
|
|
+void putchars PARAMS((Character *results));
|
|
|
|
+void digest_out PARAMS((Character *c, int ret));
|
|
|
|
+int digest PARAMS((Character *c, int clen, Character *r, int rlen, int type, int (*proc)(void)));
|
|
|
|
+void digest_shift PARAMS((Character *c, int s));
|
|
|
|
static void free_jisyo PARAMS((void));
|
|
|
|
#endif /* LIBRARY */
|
|
|
|
|
|
|
|
@@ -497,7 +506,7 @@
|
|
|
|
|
|
|
|
char *
|
|
|
|
kakasi_do(str)
|
|
|
|
- char *str;
|
|
|
|
+ unsigned char *str;
|
|
|
|
{
|
|
|
|
Character c[KAKASIBUF], r[KAKASIBUF];
|
|
|
|
int clen, ptype, pctype;
|
|
|
|
@@ -559,7 +568,13 @@
|
2002-10-06 16:51:27 +02:00
|
|
|
} else if (c[0].c1 == 0xa5) {
|
|
|
|
ptype = 5;
|
|
|
|
} else if ((c[0].c1 == 0xa1) && (c[0].c2 == 0xbc)) {
|
|
|
|
+ if (pctype == 5) {
|
2003-10-21 00:24:34 +02:00
|
|
|
ptype = 5;
|
2002-10-06 16:51:27 +02:00
|
|
|
+ } else if (pctype == 6) {
|
|
|
|
+ ptype = 6;
|
|
|
|
+ } else {
|
2003-10-21 00:24:34 +02:00
|
|
|
+ ptype = 5;
|
2002-10-06 16:51:27 +02:00
|
|
|
+ }
|
|
|
|
} else {
|
|
|
|
ptype = 4;
|
|
|
|
}
|
2003-10-21 00:24:34 +02:00
|
|
|
@@ -604,7 +619,7 @@
|
2002-10-06 16:51:27 +02:00
|
|
|
{
|
|
|
|
char *ret = getpbstr();
|
|
|
|
if (ret == NULL)
|
|
|
|
- return "";
|
|
|
|
+ return strdup("");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#endif
|