Re: Crash with cMenuEditStrItem in vdr-1.5.9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/29/07 09:33, Christian Wieninger wrote:
> Hi,
> 
> me and Rolf Ahrenberg noticed that there seems to be a problem with 
> cMenuEditStrItem in vdr-1.5.9. To reproduce it just call the timer edit 
> menu and hit 'left' on the directory item or any other cMenuEditStrItem 
> object. The following patch should fix this:
> 
> --- vdr-1.5.9/menuitems.c       2007-08-17 15:48:07.000000000 +0200
> +++ VDR/menuitems.c     2007-09-29 09:02:12.000000000 +0200
> @@ -500,7 +500,7 @@
>                         pos--;
>                      newchar = true;
>                      }
> -                 if (!insert && Utf8is(alpha, valueUtf8[pos]))
> +                 if (pos >= 0 && !insert && Utf8is(alpha, valueUtf8[pos]))
>                      uppercase = Utf8is(upper, valueUtf8[pos]);
>                   break;
>      case kRight|k_Repeat:
> 
> It happens here that pos is -1.

I would even put the whole 'if (!insert &&...' into the first
'if (pos > 0)...', because it only makes sense if an actual cursor
movement to the left has taken place:

--- menuitems.c 2007/08/17 13:48:07     1.51
+++ menuitems.c 2007/10/13 10:39:40
@@ -499,9 +499,9 @@
                     if (!insert || newchar)
                        pos--;
                     newchar = true;
+                    if (!insert && Utf8is(alpha, valueUtf8[pos]))
+                       uppercase = Utf8is(upper, valueUtf8[pos]);
                     }
-                 if (!insert && Utf8is(alpha, valueUtf8[pos]))
-                    uppercase = Utf8is(upper, valueUtf8[pos]);
                  break;
     case kRight|k_Repeat:
     case kRight: if (InEditMode())


Klaus

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux