diff options
author | vanilla <vanilla@FreeBSD.org> | 2001-10-31 05:14:55 +0000 |
---|---|---|
committer | vanilla <vanilla@FreeBSD.org> | 2001-10-31 05:14:55 +0000 |
commit | ea12d60d7ddf8912581a9aa75c238c8696b36978 (patch) | |
tree | 1cb9836affef2a02f784e670a5be0936fe2c25ab /chinese | |
parent | 084cb64c59b387da4486263a32c1563612ce1b75 (diff) | |
download | FreeBSD-ports-ea12d60d7ddf8912581a9aa75c238c8696b36978.zip FreeBSD-ports-ea12d60d7ddf8912581a9aa75c238c8696b36978.tar.gz |
Add a patch for big5 charset.
PR: mhsin@mhsin.org
Diffstat (limited to 'chinese')
-rw-r--r-- | chinese/irssi/Makefile | 3 | ||||
-rw-r--r-- | chinese/irssi/files/patch-src_fe-text_wrap.c | 57 |
2 files changed, 59 insertions, 1 deletions
diff --git a/chinese/irssi/Makefile b/chinese/irssi/Makefile index 98b24c5..47c2faa 100644 --- a/chinese/irssi/Makefile +++ b/chinese/irssi/Makefile @@ -9,7 +9,8 @@ MASTERDIR= ${.CURDIR}/../../irc/irssi EXTRA_PATCHES= ${.CURDIR}/files/patch-config.h.in \ ${.CURDIR}/files/patch-configure.in \ ${.CURDIR}/files/patch-src_fe-text_gui-entry.c \ - ${.CURDIR}/files/patch-src_fe-text_screen.h + ${.CURDIR}/files/patch-src_fe-text_screen.h \ + ${.CURDIR}/files/patch-src_fe-text_wrap.c CATEGORIES= chinese diff --git a/chinese/irssi/files/patch-src_fe-text_wrap.c b/chinese/irssi/files/patch-src_fe-text_wrap.c new file mode 100644 index 0000000..13e5834 --- /dev/null +++ b/chinese/irssi/files/patch-src_fe-text_wrap.c @@ -0,0 +1,57 @@ +--- src/fe-text/gui-windows.c.orig Mon Oct 29 20:51:52 2001 ++++ src/fe-text/gui-windows.c Tue Oct 30 01:48:09 2001 +@@ -289,6 +289,7 @@ + unsigned char cmd; + char *ptr, *last_space_ptr; + int xpos, pos, indent_pos, last_space, last_color, color; ++ int w = 0; + + g_return_val_if_fail(line->text != NULL, NULL); + +@@ -343,14 +344,14 @@ + continue; + } + +- if (xpos == COLS && sub != NULL && ++ if (xpos >= COLS && sub != NULL && + (last_space <= indent_pos || last_space <= 10)) { + /* long word, remove the indentation from this line */ + xpos -= sub->indent; + sub->indent = 0; + } + +- if (xpos == COLS) { ++ if (xpos >= COLS) { + xpos = indent_pos; + + sub = g_new(LINE_CACHE_SUB_REC, 1); +@@ -376,8 +377,27 @@ + continue; + } + +- xpos++; +- if (*ptr++ == ' ') { ++ if(ptr[1] != '\0' && is_big5(ptr[0], ptr[1])) ++ w = 2; ++ else ++ w = 1; ++ ++ xpos+=w; ++ if (*ptr == ' ' || ++ (xpos <= COLS && w > 1)) { ++ last_space = xpos-1; ++ last_space_ptr = ptr + w; ++ last_color = color; ++ } ++ if(xpos <= COLS) ++ ptr += w; ++ else ++ ptr ++; ++ ++ if(w == 1 && xpos <= COLS && ++ ptr[0] != '\0' && ptr[1] != '\0' && ++ is_big5(ptr[0], ptr[1])) ++ { + last_space = xpos-1; + last_space_ptr = ptr; + last_color = color; |