From 098142209ce24310ae15c38f815460823d0cfc63 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Aug 2006 15:11:46 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 7 ++++--- src/rxvtperl.xs | 10 ++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index b2be96af..9c8f1859 100644 --- a/Changes +++ b/Changes @@ -21,12 +21,13 @@ WISH: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the WISH: kick out xpm.C, replace by pixbuf DUMB: support tex fonts -TODO: rxvtd failing to enter cwd of rxvtc leads to crash due to free(this), Gentoo #143985 -TODO: fix crash because strwidth returning -1 in selection-popup in LC_ALL=C + - fixed urxvt::strwidth to calculate width in the same way as screen.C. + - fix a crash caused by passing negative widths to overlay functions. - give proper diagnostic when RXVT_SOCKET is too long instead of corrupting the stack (patch by exg). - urxvtd no longer crashes when the client sends an inaccessible - working directory (reported by Roland Baer). + working directory (reported by Roland Baer, possibly fixes gentoo + bug #143985). - fixed many minor issues reported by Roland Baer. 7.9 Mon Aug 7 18:16:07 CEST 2006 diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index 9db946a6..de5d62fa 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -1124,8 +1124,14 @@ rxvt_term::strwidth (SV *str) wchar_t *wstr = sv2wcs (str); rxvt_push_locale (THIS->locale); - //TODO: use same algorithm as screen.C - RETVAL = wcswidth (wstr, wcslen (wstr)); + RETVAL = 0; + for (wchar_t *wc = wstr; *wc; wc++) + { + int w = WCWIDTH (*wc); + + if (w) + RETVAL += min (w, 1); + } rxvt_pop_locale (); free (wstr); -- 2.34.1