repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 5e731b71e38879f9497440bd47fc5e5e6011e9b7: path_to: revision_to:
commit 5e731b71e38879f9497440bd47fc5e5e6011e9b7 Author: Marc LehmannDate: Mon Aug 21 15:11:46 2006 +0000 *** empty log message *** diff --git a/Changes b/Changes
--- 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
--- 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);
-----END OF PAGE-----