[resent][PATCH] elinks 0.12pre3 fails to search double-width characters

"Yuriy M. Kaminskiy" <[email protected]> Fri, 26 Jun 2009 15:26:51 +0400
Newsgroups gmane.comp.web.links
Message-ID <[email protected]>
[first message seems lost (not appear in any of ml archives), if this is
duplicate - sorry.]
Hello!
  I noticed that search for more than 1 double-width (japanese)
character fails (search for single char works), and found that get_srch
don't skip placeholders (UCS_NO_CHAR) for double-width character.
Attached patch should solve this problem.
PS just in case, same bug was in 0.12pre2 (not sure about earlier releases).
PPS did not checked with --disable-utf-8; should be no-op with gcc
warning about "cond. always false", I think.

_______________________________________________
elinks-dev mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-dev
elinks-0.12pre3-doublewidth-search.patch (text/x-diff, 414 B)
--- elinks-0.12~pre3.orig/src/viewer/text/search.c
+++ elinks-0.12~pre3/src/viewer/text/search.c
@@ -174,6 +174,10 @@  get_srch(struct document *document)
 				if (document->data[y].chars[x].attr & SCREEN_ATTR_UNSEARCHABLE)
 					continue;
 
+				/* skip double-width char placeholders */
+				if (c == UCS_NO_CHAR)
+					continue;
+
 				if (c > ' ') {
 					add_srch_chr(document, c, x, y, 1);
 					continue;