freebsd-ports/japanese/slirc/files/patch-windoze.c
2001-01-06 18:54:10 +00:00

44 lines
952 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- windoze.c.orig Sun Aug 22 20:15:00 1999
+++ windoze.c Sat Jan 6 21:23:35 2001
@@ -15,6 +15,9 @@
#include <errno.h>
#include <stdio.h>
#include <slang.h>
+#ifdef KANJI
+#include <slkanji.h>
+#endif
#include <time.h>
#include <string.h>
#include "slirc.h"
@@ -124,7 +127,19 @@
while (*p && isspace(*p)) p++ ;
q = p;
if (*p) {
+#ifdef KANJI
+ for (q = p; q < (p+tw); q++) {
+ if(iskanji(*q)) {
+ q++;
+ }
+ }
+ if (q > (p+tw)) {
+ q -= 2;
+ }
+ if (q > txth) q = txth;
+#else
q += tw; if (q > txth) q = txth;
+#endif
/* go back up to 1/3 of text-width looking for a word-break */
if (*q && !isspace(*q)) {
char *r,*rlow;
@@ -256,6 +271,11 @@
} else if (*cp == CTRL_O) {
bold = 0;
SLsmg_set_color(ColNorm);
+#ifdef KANJI
+ } else if (iskanji(*cp)){
+ SLsmg_write_nstring(cp,2);
+ cp++;
+#endif
} else if (*cp != '')
SLsmg_write_char(*cp);
}