From 572222677ee5b4a2154500786f5261cfb4ce0fc6 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 7 May 2004 10:58:23 +0000 Subject: [PATCH] Better error reporting. --- lib/image/cdrdao.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/image/cdrdao.c b/lib/image/cdrdao.c index dfc7ee81..d377ce9a 100644 --- a/lib/image/cdrdao.c +++ b/lib/image/cdrdao.c @@ -1,5 +1,5 @@ /* - $Id: cdrdao.c,v 1.2 2004/05/05 10:34:55 rocky Exp $ + $Id: cdrdao.c,v 1.3 2004/05/07 10:58:23 rocky Exp $ Copyright (C) 2004 Rocky Bernstein toc reading routine adapted from cuetools @@ -25,7 +25,7 @@ (*.cue). */ -static const char _rcsid[] = "$Id: cdrdao.c,v 1.2 2004/05/05 10:34:55 rocky Exp $"; +static const char _rcsid[] = "$Id: cdrdao.c,v 1.3 2004/05/07 10:58:23 rocky Exp $"; #include "cdio_assert.h" #include "cdio_private.h" @@ -407,7 +407,7 @@ parse_tocfile (_img_private_t *cd, const char *toc_name) unsigned int line_num=0; char *keyword, *field; int i = -1; - cdio_log_level_t log_level = (NULL == cd) ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; + cdio_log_level_t log_level = (NULL == cd) ? CDIO_LOG_INFO : CDIO_LOG_WARN; if (NULL == toc_name) return false; @@ -547,7 +547,10 @@ parse_tocfile (_img_private_t *cd, const char *toc_name) cd->tocent[i].endsize = 0; } } else { - goto format_error; + cdio_log(log_level, "%s line %d: format after keyword TRACK.", + toc_name, line_num); + cdio_log(log_level, "'%s' not a valid mode.", field); + goto err_exit; } } if (NULL != (field = strtok (NULL, " \t\n\r"))) { @@ -724,7 +727,7 @@ parse_tocfile (_img_private_t *cd, const char *toc_name) /* CD_TEXT { ... } */ /* todo: opening { must be on same line as CD_TEXT */ } else if (0 == strcmp ("CD_TEXT", keyword)) { - } else if (0 == strcmp ("LANGUAGE_MAP", keyword)) { + } else if (0 == strcmp ("LANGUAGE_MAP", keyword)) { } else if (0 == strcmp ("LANGUAGE", keyword)) { } else if (0 == strcmp ("}", keyword)) { } else if (0 == cdtext_is_keyword (keyword)) { @@ -1143,12 +1146,9 @@ _get_lba_track_cdrdao(void *env, track_t track_num) } /*! - Check that a TOC file is valid. + Check that a TOC file is valid. We parse the entire file. */ -/* Later we'll probably parse the entire file. For now though, this gets us - started for now. -*/ bool cdio_is_tocfile(const char *toc_name) {