summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-12-24 10:49:16 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2009-12-24 10:49:16 +0100
commit64b66428518942e582cde02107611160505e3570 (patch)
tree3002ac7c0dad9beb26a80f1c515776c66a532005 /channels.c
parentd8d65c7536c2569854483cb8af7cdc94afea9b44 (diff)
downloadvdr-64b66428518942e582cde02107611160505e3570.tar.gz
vdr-64b66428518942e582cde02107611160505e3570.tar.bz2
Channel names containing commas are now handled correctly in channels.conf
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channels.c b/channels.c
index b3b694bf..2c72e002 100644
--- a/channels.c
+++ b/channels.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: channels.c 2.9 2009/12/05 15:28:32 kls Exp $
+ * $Id: channels.c 2.10 2009/12/23 15:56:03 kls Exp $
*/
#include "channels.h"
@@ -727,6 +727,8 @@ cString cChannel::ToText(const cChannel *Channel)
q += sprintf(q, "%s", Channel->name);
if (!isempty(Channel->shortName))
q += sprintf(q, ",%s", Channel->shortName);
+ else if (strchr(Channel->name, ','))
+ q += sprintf(q, ",");
if (!isempty(Channel->provider))
q += sprintf(q, ";%s", Channel->provider);
*q = 0;
@@ -901,7 +903,7 @@ bool cChannel::Parse(const char *s)
*p++ = 0;
provider = strcpyrealloc(provider, p);
}
- p = strchr(namebuf, ',');
+ p = strrchr(namebuf, ','); // long name might contain a ',', so search for the rightmost one
if (p) {
*p++ = 0;
shortName = strcpyrealloc(shortName, p);