Package: icewm
Severity: normal
Tags: patch

Underline of menu hotkey is broken at multibytes string.
See this.

        http://vdr.jp/tmp/icewm-menu.png

Attached patch fixes it. Please apply.

Regards,
-- 
        dai

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16
Locale: LANG=ja_JP.EUC-JP, LC_CTYPE=ja_JP.EUC-JP (charmap=EUC-JP) (ignored: 
LC_ALL set to ja_JP.EUC-JP)
--- icewm-1.2.25/src/ypaint.cc.orig	2006-02-03 15:24:27.000000000 +0900
+++ icewm-1.2.25/src/ypaint.cc	2006-03-30 16:52:11.000000000 +0900
@@ -465,18 +465,25 @@ void Graphics::drawCharUnderline(int x, 
 #ifdef CONFIG_I18N
         if (multiByte) {
             int nc = mblen(str + c, len - c);
-            if (nc < 1) // bad things
+            if (nc < 1) { // bad things
                 c++;
-            else
-                c += nc;
+                cp++;
+            } else {
+                c  += nc;
+                cp += nc;
+            }
         } else
 #endif
+        {
             c++;
-        cp++;
+            cp++;
+        }
     }
     //    msg("%d %d %d %d %d", c, cp, charPos, left, right);
 
-    drawLine(x + left, y + 2, x + right, y + 2);
+    if( left < right ) {
+      drawLine(x + left, y + 2, x + right, y + 2);
+    }
 }
 
 void Graphics::drawStringMultiline(int x, int y, const char *str) {

Reply via email to