Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 249624
Collapse All | Expand All

(-)mc-utf8.patch (-3 / +7 lines)
Lines 437-443 diff -up mc-4.6.2-pre1/src/widget.c.utf8 Link Here
437
+	l = mbrtowc(&wc, in->buffer + pos, len - pos, &mbs);
437
+	l = mbrtowc(&wc, in->buffer + pos, len - pos, &mbs);
438
+	if (l <= 0)
438
+	if (l <= 0)
439
+	    return width;
439
+	    return width;
440
+	pos += l; width += wcwidth(wc);
440
+	pos += l; if (wcwidth(wc)>0 && in->is_password) {width++;} else width += wcwidth(wc);
441
+	i++;
441
+	i++;
442
+    };
442
+    };
443
+    return width;
443
+    return width;
Lines 487-493 diff -up mc-4.6.2-pre1/src/widget.c.utf8 Link Here
487
+    for (i = 0, j = in->first_shown; (i < in->field_len - has_history) && (j < buf_len); i++,j++){
487
+    for (i = 0, j = in->first_shown; (i < in->field_len - has_history) && (j < buf_len); i++,j++){
488
+	char * chp = in->buffer + charpos(in,j);
488
+	char * chp = in->buffer + charpos(in,j);
489
+	size_t res = mbrtowc(&c, chp, strlen(chp), &mbs);
489
+	size_t res = mbrtowc(&c, chp, strlen(chp), &mbs);
490
+	c = (res && iswprint (c)) ? 0 : '.';
490
+	if (res == 0) continue; c = (iswprint (c)) ? 0 : L'.';
491
+#endif /* UTF8 */
491
+#endif /* UTF8 */
492
+	if (in->is_password) 
492
+	if (in->is_password) 
493
 	    c = '*';
493
 	    c = '*';
Lines 1481-1487 diff -up mc-4.6.2-pre1/src/view.c.utf8 m Link Here
1481
 	    int c_prev;
1481
 	    int c_prev;
1482
 	    int c_next;
1482
 	    int c_next;
1483
 
1483
 
1484
@@ -1988,10 +2027,17 @@ view_display_text (WView * view)
1484
@@ -1988,10 +2027,21 @@ view_display_text (WView * view)
1485
 	if (col >= view->dpy_text_column
1485
 	if (col >= view->dpy_text_column
1486
 	    && col - view->dpy_text_column < width) {
1486
 	    && col - view->dpy_text_column < width) {
1487
 	    widget_move (view, top + row, left + (col - view->dpy_text_column));
1487
 	    widget_move (view, top + row, left + (col - view->dpy_text_column));
Lines 1495-1500 diff -up mc-4.6.2-pre1/src/view.c.utf8 m Link Here
1495
+	    if (!iswprint (wc))
1495
+	    if (!iswprint (wc))
1496
+		wc = '.';
1496
+		wc = '.';
1497
+	    tty_print_char (wc);
1497
+	    tty_print_char (wc);
1498
+	    {
1499
+	    int cw = wcwidth(wc);
1500
+	    if (cw > 1) col+= cw - 1;
1501
+	    }
1498
+#endif
1502
+#endif
1499
 	}
1503
 	}
1500
 	col++;
1504
 	col++;
Lines 5392-5423 diff -up mc-4.6.2-pre1/acinclude.m4.utf8 Link Here
5392
 
5396
 
5393
     if test x$with_screen = xslang; then
5397
     if test x$with_screen = xslang; then
5394
 	AC_DEFINE(HAVE_SYSTEM_SLANG, 1,
5398
 	AC_DEFINE(HAVE_SYSTEM_SLANG, 1,

Return to bug 249624