FreeBSD Bugzilla – Attachment 126070 Details for
Bug 169780
[patch] add patch to fix utf-8 decoding bug for irc/irssi
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.68 KB, created by
buganini
on 2012-07-11 08:30:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
buganini
Created:
2012-07-11 08:30:02 UTC
Size:
1.68 KB
patch
obsolete
>diff -ruN irssi.orig/Makefile irssi/Makefile >--- irssi.orig/Makefile 2012-07-11 15:19:59.000000000 +0800 >+++ irssi/Makefile 2012-07-11 15:23:37.000000000 +0800 >@@ -7,7 +7,7 @@ > > PORTNAME= irssi > PORTVERSION= 0.8.15 >-PORTREVISION= 3 >+PORTREVISION= 4 > CATEGORIES?= irc > MASTER_SITES= http://mirror.irssi.org/ > >diff -ruN irssi.orig/files/patch-irssi-utf8 irssi/files/patch-irssi-utf8 >--- irssi.orig/files/patch-irssi-utf8 1970-01-01 08:00:00.000000000 +0800 >+++ irssi/files/patch-irssi-utf8 2012-06-10 13:10:50.000000000 +0800 >@@ -0,0 +1,40 @@ >+Index: src/fe-common/core/utf8.h >+=================================================================== >+--- src/fe-common/core/utf8.h (revision 5189) >++++ src/fe-common/core/utf8.h (working copy) >+@@ -12,5 +12,6 @@ >+ int mk_wcwidth(unichar c); >+ >+ #define unichar_isprint(c) (((c) & ~0x80) >= 32) >++#define is_utf8_leading(c) (((c) & 0xc0) != 0x80) >+ >+ #endif >+Index: src/fe-text/textbuffer.c >+=================================================================== >+--- src/fe-text/textbuffer.c (revision 5189) >++++ src/fe-text/textbuffer.c (working copy) >+@@ -23,6 +23,7 @@ >+ #include "module.h" >+ #include "misc.h" >+ #include "formats.h" >++#include "utf8.h" >+ >+ #include "textbuffer.h" >+ >+@@ -157,6 +158,16 @@ >+ if (left > 0 && data[left-1] == 0) >+ left--; /* don't split the commands */ >+ >++ /* don't split utf-8 character. (assume we can split non-utf8 anywhere. */ >++ if (left < TEXT_CHUNK_USABLE_SIZE && !is_utf8_leading(data[left])) { >++ int i; >++ for (i = 1; i < 4 && left >= i; i++) >++ if (is_utf8_leading(data[left - i])) { >++ left -= i; >++ break; >++ } >++ } >++ >+ memcpy(chunk->buffer + chunk->pos, data, left); >+ chunk->pos += left; >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 169780
: 126070