diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-01-05 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-01-05 18:00:00 +0100 |
commit | 6d4eb0df37c2669176677abeeb664da58f945d5f (patch) | |
tree | 2e675b58652619a211717e4e18808f9ffc023d70 /menuitems.c | |
parent | 20e2335d3e1f6fa6ec6ffcc73117b438858ed52c (diff) | |
download | vdr-patch-lnbsharing-6d4eb0df37c2669176677abeeb664da58f945d5f.tar.gz vdr-patch-lnbsharing-6d4eb0df37c2669176677abeeb664da58f945d5f.tar.bz2 |
Version 1.4.4-3vdr-1.4.4-3
- Fixed a possible segfault if VDR gets terminated while a message is displayed
(thanks to Udo Richter).
- Fixed the INSTALL section on retrying shutdown later (reported by Udo Richter).
- When entering text via the numeric keys, the characters are now checked against
the allowed characters (thanks to Frank Schmirler).
- Added a missing break statement in cCiHandler::OpenSession().
Diffstat (limited to 'menuitems.c')
-rw-r--r-- | menuitems.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/menuitems.c b/menuitems.c index 086668e..366989d 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c 1.47 2006/07/30 09:09:30 kls Exp $ + * $Id: menuitems.c 1.48 2007/01/04 13:30:37 kls Exp $ */ #include "menuitems.h" @@ -461,13 +461,6 @@ eOSState cMenuEditStrItem::ProcessKey(eKeys Key) AdvancePos(); currentChar = NULL; } - if (insert && newchar) { - // create a new character in insert mode - if (int(strlen(value)) < length - 1) { - memmove(value + pos + 1, value + pos, strlen(value) - pos + 1); - value[pos] = ' '; - } - } if (!currentChar || !*currentChar || *currentChar == '\t') { // find the beginning of the character map entry for Key int n = NORMALKEY(Key) - k0; @@ -476,15 +469,28 @@ eOSState cMenuEditStrItem::ProcessKey(eKeys Key) if (*currentChar++ == '\t') n--; } + // find first allowed character + while (*currentChar && *currentChar != '\t' && !strchr(allowed, *currentChar)) + currentChar++; } if (*currentChar && *currentChar != '\t') { + if (insert && newchar) { + // create a new character in insert mode + if (int(strlen(value)) < length - 1) { + memmove(value + pos + 1, value + pos, strlen(value) - pos + 1); + value[pos] = ' '; + } + } value[pos] = *currentChar; if (uppercase) value[pos] = toupper(value[pos]); - currentChar++; + // find next allowed character + do { + currentChar++; + } while (*currentChar && *currentChar != '\t' && !strchr(allowed, *currentChar)); + newchar = false; + autoAdvanceTimeout.Set(AUTO_ADVANCE_TIMEOUT); } - newchar = false; - autoAdvanceTimeout.Set(AUTO_ADVANCE_TIMEOUT); } else return cMenuEditItem::ProcessKey(Key); |