diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-07-22 10:48:22 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-07-22 10:48:22 +0200 |
commit | 5f0b2fbf2e54724af021e5f1b1a803d0936d5f3d (patch) | |
tree | 469b9797d12b5812f80d1723338cf6b716665a8f /epg.c | |
parent | e9a90f7972087c7cf1ba4aee9ee19d6d66c42169 (diff) | |
download | vdr-5f0b2fbf2e54724af021e5f1b1a803d0936d5f3d.tar.gz vdr-5f0b2fbf2e54724af021e5f1b1a803d0936d5f3d.tar.bz2 |
Newlines in title and short text of an EPG event are now changed into blanks only after all other fixes
Diffstat (limited to 'epg.c')
-rw-r--r-- | epg.c | 34 |
1 files changed, 18 insertions, 16 deletions
@@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * - * $Id: epg.c 1.76 2006/07/22 09:13:15 kls Exp $ + * $Id: epg.c 1.77 2006/07/22 10:13:34 kls Exp $ */ #include "epg.h" @@ -435,18 +435,6 @@ void ReportEpgBugFixStats(bool Reset) void cEvent::FixEpgBugs(void) { - // VDR can't usefully handle newline characters in the title and shortText of EPG - // data, so let's always convert them to blanks (independent of the setting of EPGBugfixLevel): - strreplace(title, '\n', ' '); - strreplace(shortText, '\n', ' '); - // Same for control characters: - strreplace(title, '\x86', ' '); - strreplace(title, '\x87', ' '); - strreplace(shortText, '\x86', ' '); - strreplace(shortText, '\x87', ' '); - strreplace(description, '\x86', ' '); - strreplace(description, '\x87', ' '); - if (isempty(title)) { // we don't want any "(null)" titles title = strcpyrealloc(title, tr("No title")); @@ -454,7 +442,7 @@ void cEvent::FixEpgBugs(void) } if (Setup.EPGBugfixLevel == 0) - return; + goto Final; // Some TV stations apparently have their own idea about how to fill in the // EPG data. Let's fix their bugs as good as we can: @@ -528,7 +516,7 @@ void cEvent::FixEpgBugs(void) } if (Setup.EPGBugfixLevel <= 1) - return; + goto Final; // Some channels apparently try to do some formatting in the texts, // which is a bad idea because they have no way of knowing the width @@ -574,7 +562,7 @@ void cEvent::FixEpgBugs(void) strreplace(description, '`', '\''); if (Setup.EPGBugfixLevel <= 2) - return; + goto Final; // The stream components have a "description" field which some channels // apparently have no idea of how to set correctly: @@ -638,6 +626,20 @@ void cEvent::FixEpgBugs(void) } } } + +Final: + + // VDR can't usefully handle newline characters in the title and shortText of EPG + // data, so let's always convert them to blanks (independent of the setting of EPGBugfixLevel): + strreplace(title, '\n', ' '); + strreplace(shortText, '\n', ' '); + // Same for control characters: + strreplace(title, '\x86', ' '); + strreplace(title, '\x87', ' '); + strreplace(shortText, '\x86', ' '); + strreplace(shortText, '\x87', ' '); + strreplace(description, '\x86', ' '); + strreplace(description, '\x87', ' '); } // --- cSchedule ------------------------------------------------------------- |