summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-07-15 16:35:18 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-07-15 16:35:18 +0200
commitc9e45322981dbe4c235ad7b9909138626184666f (patch)
treeee9a63907dc6bf1fff8b208e9ec46bb26589c61f /config.c
parent744849128df1318b70349223685d9fce8cf805c5 (diff)
downloadvdr-c9e45322981dbe4c235ad7b9909138626184666f.tar.gz
vdr-c9e45322981dbe4c235ad7b9909138626184666f.tar.bz2
Fixed/improved LIRC key handling
Diffstat (limited to 'config.c')
-rw-r--r--config.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/config.c b/config.c
index 16f44124..32fa17f9 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c 1.8 2000/07/15 12:39:20 kls Exp $
+ * $Id: config.c 1.9 2000/07/15 16:35:18 kls Exp $
*/
#include "config.h"
@@ -54,6 +54,12 @@ void cKeys::Clear(void)
k->code = 0;
}
+void cKeys::SetDummyValues(void)
+{
+ for (tKey *k = keys; k->type != kNone; k++)
+ k->code = k->type + 1; // '+1' to avoid 0
+}
+
bool cKeys::Load(char *FileName)
{
isyslog(LOG_INFO, "loading %s", FileName);
@@ -150,7 +156,7 @@ unsigned int cKeys::Encode(const char *Command)
{
if (Command != NULL) {
const tKey *k = keys;
- while ((k->type != kNone) && strncmp(k->name, Command, strlen(k->name)) != 0) // must use 'strncmp()' because LIRC delivers trailing characters!
+ while ((k->type != kNone) && strcmp(k->name, Command) != 0)
k++;
return k->code;
}