From 1fd16f6629d4297268e6ff8470444a7169421286 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 13 Mar 2004 12:41:24 +0100 Subject: Any newline characters in the 'description' of EPG events are now preserved --- HISTORY | 3 +++ epg.c | 16 ++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/HISTORY b/HISTORY index 7f7abc2d..ef115a4f 100644 --- a/HISTORY +++ b/HISTORY @@ -2733,3 +2733,6 @@ Video Disk Recorder Revision History - Taking the Sid into account when detecting version changes in processing the PMT (thanks to Stéphane Esté-Gracias for pointing out this problem). - Completed the Russian OSD texts (thanks to Vyacheslav Dikonov). +- Any newline characters in the 'description' of EPG events are now preserved + to allow texts to be displayed the way the tv stations have formatted them. + This was also necessary to better display itemized texts. diff --git a/epg.c b/epg.c index 4ffea63f..c93594d5 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 1.16 2004/03/06 14:33:22 kls Exp $ + * $Id: epg.c 1.17 2004/03/13 12:41:24 kls Exp $ */ #include "epg.h" @@ -151,8 +151,11 @@ void cEvent::Dump(FILE *f, const char *Prefix) const fprintf(f, "%sT %s\n", Prefix, title); if (!isempty(shortText)) fprintf(f, "%sS %s\n", Prefix, shortText); - if (!isempty(description)) + if (!isempty(description)) { + strreplace(description, '\n', '|'); fprintf(f, "%sD %s\n", Prefix, description); + strreplace(description, '|', '\n'); + } if (vps) fprintf(f, "%sV %ld\n", Prefix, vps); fprintf(f, "%se\n", Prefix); @@ -191,8 +194,10 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule) case 'S': if (Event) Event->SetShortText(t); break; - case 'D': if (Event) + case 'D': if (Event) { + strreplace(t, '|', '\n'); Event->SetDescription(t); + } break; case 'V': if (Event) Event->SetVps(atoi(t)); @@ -287,11 +292,10 @@ void ReportEpgBugFixStats(bool Reset) void cEvent::FixEpgBugs(void) { - // VDR can't usefully handle newline characters in the EPG data, so let's - // always convert them to blanks (independent of the setting of EPGBugfixLevel): + // 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', ' '); - strreplace(description, '\n', ' '); // Same for control characters: strreplace(title, '\x86', ' '); strreplace(title, '\x87', ' '); -- cgit v1.2.3