summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-11-02 18:07:05 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-11-02 18:07:05 +0100
commit2a7f8325d1b2f5e5dc1c087babff07c27cd6870d (patch)
treedb213072061b8af25c4a5ddc644452e9ab6e4d52 /channels.c
parent6304820a0eafabf050e27cf5924934367b6954ab (diff)
downloadvdr-2a7f8325d1b2f5e5dc1c087babff07c27cd6870d.tar.gz
vdr-2a7f8325d1b2f5e5dc1c087babff07c27cd6870d.tar.bz2
Fixed cChannel::SetName() in case only the ShortName or Provider has changed
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/channels.c b/channels.c
index 57986e35..5d500ece 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 1.30 2004/10/31 12:54:06 kls Exp $
+ * $Id: channels.c 1.31 2004/11/02 18:07:05 kls Exp $
*/
#include "channels.h"
@@ -358,15 +358,23 @@ void cChannel::SetId(int Nid, int Tid, int Sid, int Rid)
void cChannel::SetName(const char *Name, const char *ShortName, const char *Provider)
{
- if (!isempty(Name) && strcmp(name, Name) != 0) {
- if (Number()) {
- dsyslog("changing name of channel %d from '%s,%s;%s' to '%s,%s;%s'", Number(), name, shortName, provider, Name, ShortName, Provider);
- modification |= CHANNELMOD_NAME;
- Channels.SetModified();
+ if (!isempty(Name)) {
+ bool nn = strcmp(name, Name) != 0;
+ bool ns = strcmp(shortName, ShortName) != 0;
+ bool np = strcmp(provider, Provider) != 0;
+ if (nn || ns || np) {
+ if (Number()) {
+ dsyslog("changing name of channel %d from '%s,%s;%s' to '%s,%s;%s'", Number(), name, shortName, provider, Name, ShortName, Provider);
+ modification |= CHANNELMOD_NAME;
+ Channels.SetModified();
+ }
+ if (nn)
+ name = strcpyrealloc(name, Name);
+ if (ns)
+ shortName = strcpyrealloc(shortName, ShortName);
+ if (np)
+ provider = strcpyrealloc(provider, Provider);
}
- name = strcpyrealloc(name, Name);
- shortName = strcpyrealloc(shortName, ShortName);
- provider = strcpyrealloc(provider, Provider);
}
}