diff options
author | Vanilla I. Shu <vanilla@FreeBSD.org> | 2002-03-08 16:49:29 +0000 |
---|---|---|
committer | Vanilla I. Shu <vanilla@FreeBSD.org> | 2002-03-08 16:49:29 +0000 |
commit | 55112eb138709196e8c3621a7e745d4c570829ba (patch) | |
tree | e4415f1c9233e9f025f61bd16caf31bd78cc8e0f /chinese | |
parent | 64baa5ac91d199d8bfc29183724a800ff150836d (diff) | |
download | ports-55112eb138709196e8c3621a7e745d4c570829ba.tar.gz ports-55112eb138709196e8c3621a7e745d4c570829ba.zip |
fix that history backward/forward functions invalid the multi-bytes
cursor movement.
PR: ports/35560
Submitted by: Chou Yeh-Jyi <yjchou@cis.nctu.edu.tw>
Notes
Notes:
svn path=/head/; revision=55730
Diffstat (limited to 'chinese')
-rw-r--r-- | chinese/irssi/Makefile | 3 | ||||
-rw-r--r-- | chinese/irssi/files/patch-src::fe-text::gui-entry.c | 47 | ||||
-rw-r--r-- | chinese/irssi/files/patch-src::fe-text::gui-entry.h | 20 |
3 files changed, 64 insertions, 6 deletions
diff --git a/chinese/irssi/Makefile b/chinese/irssi/Makefile index 92552699249b..d7a0cc15c4b2 100644 --- a/chinese/irssi/Makefile +++ b/chinese/irssi/Makefile @@ -8,11 +8,12 @@ MASTERDIR= ${.CURDIR}/../../irc/irssi EXTRA_PATCHES= ${.CURDIR}/files/patch-irssi.conf \ ${.CURDIR}/files/patch-src::fe-text::gui-entry.c \ + ${.CURDIR}/files/patch-src::fe-text::gui-entry.h \ ${.CURDIR}/files/patch-src::fe-text::term-terminfo.c \ ${.CURDIR}/files/patch-src::fe-text::textbuffer-view.c \ ${.CURDIR}/files/patch-src::fe-text::utf8.h -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= chinese MAINTAINER= vanilla@FreeBSD.org diff --git a/chinese/irssi/files/patch-src::fe-text::gui-entry.c b/chinese/irssi/files/patch-src::fe-text::gui-entry.c index f40254b53bd4..6e4ee5362f33 100644 --- a/chinese/irssi/files/patch-src::fe-text::gui-entry.c +++ b/chinese/irssi/files/patch-src::fe-text::gui-entry.c @@ -1,6 +1,16 @@ --- src/fe-text/gui-entry.c.orig Sat Feb 16 19:10:11 2002 -+++ src/fe-text/gui-entry.c Sun Mar 3 10:29:10 2002 -@@ -67,6 +69,27 @@ ++++ src/fe-text/gui-entry.c Sat Mar 9 00:38:18 2002 +@@ -37,7 +37,8 @@ + return; + + entry->text_alloc = nearest_power(entry->text_alloc+grow_size); +- entry->text = g_realloc(entry->text, entry->text_alloc); ++ entry->text = g_realloc(entry->text, ++ sizeof(unichar) * entry->text_alloc); + } + + GUI_ENTRY_REC *gui_entry_create(int xpos, int ypos, int width, int utf8) +@@ -67,6 +68,27 @@ g_free(entry); } @@ -28,7 +38,7 @@ /* Fixes the cursor position in screen */ static void gui_entry_fix_cursor(GUI_ENTRY_REC *entry) { -@@ -84,6 +107,8 @@ +@@ -84,6 +106,8 @@ entry->scrstart = entry->pos - entry->scrpos; } @@ -37,7 +47,34 @@ if (old_scrstart != entry->scrstart) entry->redraw_needed_from = 0; } -@@ -335,11 +360,18 @@ +@@ -195,7 +219,7 @@ + } + } + +-void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str) ++void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const unsigned char *str) + { + int oldlen; + +@@ -231,7 +255,7 @@ + entry->utf8 = utf8; + } + +-void gui_entry_set_text(GUI_ENTRY_REC *entry, const char *str) ++void gui_entry_set_text(GUI_ENTRY_REC *entry, const unsigned char *str) + { + g_return_if_fail(entry != NULL); + g_return_if_fail(str != NULL); +@@ -260,7 +284,7 @@ + return buf; + } + +-void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str) ++void gui_entry_insert_text(GUI_ENTRY_REC *entry, const unsigned char *str) + { + unichar chr; + int i, len; +@@ -335,11 +359,18 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size) { @@ -56,7 +93,7 @@ /* put erased text to cutbuffer */ if (entry->cutbuffer == NULL || entry->cutbuffer_len < size) { g_free(entry->cutbuffer); -@@ -461,10 +493,24 @@ +@@ -461,10 +492,24 @@ void gui_entry_move_pos(GUI_ENTRY_REC *entry, int pos) { diff --git a/chinese/irssi/files/patch-src::fe-text::gui-entry.h b/chinese/irssi/files/patch-src::fe-text::gui-entry.h new file mode 100644 index 000000000000..def901ce56b7 --- /dev/null +++ b/chinese/irssi/files/patch-src::fe-text::gui-entry.h @@ -0,0 +1,20 @@ +--- src/fe-text/gui-entry.h.orig Sat Mar 9 00:22:21 2002 ++++ src/fe-text/gui-entry.h Sat Mar 9 00:22:48 2002 +@@ -28,14 +28,14 @@ + void gui_entry_move(GUI_ENTRY_REC *entry, int xpos, int ypos, int width); + void gui_entry_set_active(GUI_ENTRY_REC *entry); + +-void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str); ++void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const unsigned char *str); + void gui_entry_set_hidden(GUI_ENTRY_REC *entry, int hidden); + void gui_entry_set_utf8(GUI_ENTRY_REC *entry, int utf8); + +-void gui_entry_set_text(GUI_ENTRY_REC *entry, const char *str); ++void gui_entry_set_text(GUI_ENTRY_REC *entry, const unsigned char *str); + char *gui_entry_get_text(GUI_ENTRY_REC *entry); + +-void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str); ++void gui_entry_insert_text(GUI_ENTRY_REC *entry, const unsigned char *str); + void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr); + + char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry); |