diff options
author | vanilla <vanilla@FreeBSD.org> | 2002-01-28 17:10:52 +0800 |
---|---|---|
committer | vanilla <vanilla@FreeBSD.org> | 2002-01-28 17:10:52 +0800 |
commit | ebf34b7462b3578a50cdecd9bbc7693548c22cf1 (patch) | |
tree | 53848efd4dd3b00dcf22d921c84eac56fb040c65 /chinese/irssi | |
parent | d85f6099f3372f7db1aeb512afbcd4e52d1fef06 (diff) | |
download | freebsd-ports-gnome-ebf34b7462b3578a50cdecd9bbc7693548c22cf1.tar.gz freebsd-ports-gnome-ebf34b7462b3578a50cdecd9bbc7693548c22cf1.tar.zst freebsd-ports-gnome-ebf34b7462b3578a50cdecd9bbc7693548c22cf1.zip |
Fix crash when ^K at beginning of line
PR: ports/34343
Submitted by: Michael Hsin <mhsin@mhsin.org>
Diffstat (limited to 'chinese/irssi')
-rw-r--r-- | chinese/irssi/Makefile | 2 | ||||
-rw-r--r-- | chinese/irssi/files/patch-src_fe-text_gui-entry.c | 39 |
2 files changed, 29 insertions, 12 deletions
diff --git a/chinese/irssi/Makefile b/chinese/irssi/Makefile index 901c9057e83d..dd758a858581 100644 --- a/chinese/irssi/Makefile +++ b/chinese/irssi/Makefile @@ -12,7 +12,7 @@ EXTRA_PATCHES= ${.CURDIR}/files/patch-config.h.in \ ${.CURDIR}/files/patch-src_fe-text_screen.h \ ${.CURDIR}/files/patch-src_fe-text_window.c -PORTREVISION= 2 +PORTREVISION= 3 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 1b349680a57e..a621af8e6e6b 100644 --- a/chinese/irssi/files/patch-src_fe-text_gui-entry.c +++ b/chinese/irssi/files/patch-src_fe-text_gui-entry.c @@ -1,10 +1,12 @@ --- src/fe-text/gui-entry.c.orig Sun Mar 4 02:04:10 2001 -+++ src/fe-text/gui-entry.c Mon Nov 5 01:40:11 2001 -@@ -29,6 +29,26 @@ ++++ src/fe-text/gui-entry.c Sat Jan 26 20:38:19 2002 +@@ -29,6 +29,28 @@ static int prompt_hidden; static char *prompt; +#ifdef WANT_BIG5 ++#include "settings.h" ++ +int gui_is_big5(char *str, int pos) +{ + int a; @@ -27,7 +29,7 @@ static void entry_screenpos(void) { if (pos-scrstart < COLS-2-promptlen && pos-scrstart > 0) { -@@ -42,6 +62,14 @@ +@@ -42,6 +64,14 @@ } else { scrpos = (COLS-promptlen)*2/3; scrstart = pos-scrpos; @@ -42,29 +44,44 @@ } } -@@ -152,6 +180,11 @@ +@@ -152,6 +182,12 @@ { if (pos < size) return; +#ifdef WANT_BIG5 -+ if (gui_is_big5(entry->str, pos - 2)) -+ size++; ++ if (settings_get_bool("big5_cursor_movement")) ++ if(size == 1 && gui_is_big5(entry->str, pos - 2)) ++ size++; +#endif WANT_BIG5 + pos -= size; g_string_erase(entry, pos, size); -@@ -217,6 +250,13 @@ +@@ -217,6 +253,16 @@ void gui_entry_move_pos(int p) { +#ifdef WANT_BIG5 -+ if (p > 0 && gui_is_big5(entry->str, pos)) -+ p++; -+ else if (p < 0 && gui_is_big5(entry->str, pos - 2)) -+ p--; ++ if(settings_get_bool("big5_cursor_movement")) ++ { ++ if (p == 1 && gui_is_big5(entry->str, pos)) ++ p++; ++ else if (p == -1 && gui_is_big5(entry->str, pos - 2)) ++ p--; ++ } +#endif WANT_BIG5 + if (pos+p >= 0 && pos+p <= entry->len) pos += p; +@@ -277,6 +323,9 @@ + prompt = NULL; promptlen = 0; + permanent_prompt = FALSE; + prompt_hidden = FALSE; ++#ifdef WANT_BIG5 ++ settings_add_bool("fe-text", "big5_cursor_movement", FALSE); ++#endif WANT_BIG5 + } + + void gui_entry_deinit(void) + |