1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Added more error messages and line numbers when reading EPG data and info.vdr

This commit is contained in:
Klaus Schmidinger 2005-10-09 13:13:36 +02:00
parent bf779b3bfe
commit 53e840af50
4 changed files with 17 additions and 5 deletions

View File

@ -920,6 +920,7 @@ Peter Bieringer <pb@bieringer.de>
for reporting a problem with duplicate recordings with the same file name for reporting a problem with duplicate recordings with the same file name
for suggesting to implement the command line option '--vfat' for suggesting to implement the command line option '--vfat'
for reporting a leftover 'summary.vdr' in vdr.5 for reporting a leftover 'summary.vdr' in vdr.5
for adding more error messages and line numbers when reading EPG data and info.vdr
Alexander Damhuis <ad@phonedation.de> Alexander Damhuis <ad@phonedation.de>
for reporting problems when deleting a timer that is currently recording for reporting problems when deleting a timer that is currently recording

View File

@ -3899,3 +3899,5 @@ Video Disk Recorder Revision History
to Darren Salt). to Darren Salt).
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Fixed a leftover 'summary.vdr' in vdr.1 (reported by Christoph Hermanns). - Fixed a leftover 'summary.vdr' in vdr.1 (reported by Christoph Hermanns).
- Added more error messages and line numbers when reading EPG data and info.vdr
(thanks to Peter Bieringer).

8
epg.c
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* *
* $Id: epg.c 1.37 2005/09/09 15:14:11 kls Exp $ * $Id: epg.c 1.38 2005/10/09 12:57:55 kls Exp $
*/ */
#include "epg.h" #include "epg.h"
@ -285,8 +285,10 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
if (Schedule) { if (Schedule) {
cEvent *Event = NULL; cEvent *Event = NULL;
char *s; char *s;
int line = 0;
cReadLine ReadLine; cReadLine ReadLine;
while ((s = ReadLine.Read(f)) != NULL) { while ((s = ReadLine.Read(f)) != NULL) {
line++;
char *t = skipspace(s + 1); char *t = skipspace(s + 1);
switch (*s) { switch (*s) {
case 'E': if (!Event) { case 'E': if (!Event) {
@ -316,10 +318,12 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
break; break;
case 'c': // to keep things simple we react on 'c' here case 'c': // to keep things simple we react on 'c' here
return true; return true;
default: if (Event && !Event->Parse(s)) default: if (Event && !Event->Parse(s)) {
esyslog("ERROR: EPG data problem in line %d", line);
return false; return false;
} }
} }
}
esyslog("ERROR: unexpected end of file while reading EPG data"); esyslog("ERROR: unexpected end of file while reading EPG data");
} }
return false; return false;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.120 2005/10/01 10:29:02 kls Exp $ * $Id: recording.c 1.121 2005/10/09 13:09:51 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -264,7 +264,9 @@ bool cRecordingInfo::Read(FILE *f)
if (ownEvent) { if (ownEvent) {
cReadLine ReadLine; cReadLine ReadLine;
char *s; char *s;
int line = 0;
while ((s = ReadLine.Read(f)) != NULL) { while ((s = ReadLine.Read(f)) != NULL) {
++line;
char *t = skipspace(s + 1); char *t = skipspace(s + 1);
switch (*s) { switch (*s) {
case 'C': { case 'C': {
@ -275,8 +277,10 @@ bool cRecordingInfo::Read(FILE *f)
channelID = tChannelID::FromString(t); channelID = tChannelID::FromString(t);
} }
break; break;
default: if (!ownEvent->Parse(s)) default: if (!ownEvent->Parse(s)) {
esyslog("ERROR: EPG data problem in line %d", line);
return false; return false;
}
break; break;
} }
} }
@ -478,7 +482,8 @@ cRecording::cRecording(const char *FileName)
asprintf(&InfoFileName, "%s%s", fileName, INFOFILESUFFIX); asprintf(&InfoFileName, "%s%s", fileName, INFOFILESUFFIX);
FILE *f = fopen(InfoFileName, "r"); FILE *f = fopen(InfoFileName, "r");
if (f) { if (f) {
info->Read(f); if (!info->Read(f))
esyslog("ERROR: EPG data problem in file %s", InfoFileName);
fclose(f); fclose(f);
} }
else if (errno != ENOENT) else if (errno != ENOENT)