From 64b66428518942e582cde02107611160505e3570 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Thu, 24 Dec 2009 10:49:16 +0100 Subject: [PATCH] Channel names containing commas are now handled correctly in channels.conf --- HISTORY | 5 +++-- channels.c | 6 ++++-- sdt.c | 7 ++++++- vdr.5 | 6 +++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/HISTORY b/HISTORY index b15ca417..37aac912 100644 --- a/HISTORY +++ b/HISTORY @@ -6197,7 +6197,7 @@ Video Disk Recorder Revision History - Fixed the default value for "Pause key handling" in the MANUAL (reported by Diego Pierotto). -2009-12-23: Version 1.7.11 +2009-12-24: Version 1.7.11 - Fixed resetting the file size when regenerating the index file. - The new function cDevice::PatPmtParser() can be used in derived devices to access @@ -6222,4 +6222,5 @@ Video Disk Recorder Revision History - Updated sources.conf (thanks to Derek Kelly). - Modified cCharSetConv so that it can be used to convert from "whatever VDR uses" to a given code (thanks to Joachim Wilke). - +- Channel names containing commas are now handled correctly in channels.conf. + If a channel's short name contains a comma, it is replaced with a '.'. 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); diff --git a/sdt.c b/sdt.c index de100966..1ed9b32a 100644 --- a/sdt.c +++ b/sdt.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: sdt.c 2.3 2009/12/13 11:54:33 kls Exp $ + * $Id: sdt.c 2.4 2009/12/23 16:02:47 kls Exp $ */ #include "sdt.h" @@ -72,6 +72,11 @@ void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length strcpy(ShortNameBuf, skipspace(p)); } } + // Avoid ',' in short name (would cause trouble in channels.conf): + for (char *p = ShortNameBuf; *p; p++) { + if (*p == ',') + *p = '.'; + } sd->providerName.getText(ProviderNameBuf, sizeof(ProviderNameBuf)); char *pp = compactspace(ProviderNameBuf); if (channel) { diff --git a/vdr.5 b/vdr.5 index e1023af1..b026b011 100644 --- a/vdr.5 +++ b/vdr.5 @@ -8,7 +8,7 @@ .\" License as specified in the file COPYING that comes with the .\" vdr distribution. .\" -.\" $Id: vdr.5 2.7 2009/10/18 14:09:07 kls Exp $ +.\" $Id: vdr.5 2.8 2009/12/24 10:47:38 kls Exp $ .\" .TH vdr 5 "10 Feb 2008" "1.6" "Video Disk Recorder Files" .SH NAME @@ -65,6 +65,10 @@ as in \fBRTL Television,RTL:...\fR +If the short name itself would contain a comma, it is replaced with a '.'. +Note that some long channel names may contain a comma, so the delimiting comma +is always the rightmost one. + If present, the name of the service provider or "bouquet" is appended to the channel name, separated by a semicolon, as in