From 16f3d3fc5d2f883241147db6ed9622a58f73b7c0 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 19 Oct 2002 11:34:48 +0200 Subject: Fixed handling multiple 'CaCaps' entries in 'setup.conf' --- config.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index d9cdb43c..f4ef7b86 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.109 2002/10/13 10:03:49 kls Exp $ + * $Id: config.c 1.110 2002/10/19 11:34:01 kls Exp $ */ #include "config.h" @@ -680,11 +680,11 @@ cSetupLine *cSetup::Get(const char *Name, const char *Plugin) return NULL; } -void cSetup::Store(const char *Name, const char *Value, const char *Plugin) +void cSetup::Store(const char *Name, const char *Value, const char *Plugin, bool AllowMultiple) { if (Name && *Name) { cSetupLine *l = Get(Name, Plugin); - if (l) + if (l && !AllowMultiple) Del(l); if (Value) Add(new cSetupLine(Name, Value, Plugin)); @@ -726,6 +726,9 @@ bool cSetup::Load(const char *FileName) void cSetup::StoreCaCaps(const char *Name) { + cSetupLine *l; + while ((l = Get(Name)) != NULL) + Del(l); for (int d = 0; d < MAXDEVICES; d++) { char buffer[MAXPARSEBUFFER]; char *q = buffer; @@ -738,7 +741,7 @@ void cSetup::StoreCaCaps(const char *Name) } } if (*buffer) - Store(Name, buffer); + Store(Name, buffer, NULL, true); } } -- cgit v1.2.3