From da6d33e0a7a2e57b154824c2f820014bdd7ba1b5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 6 Mar 2005 21:43:33 +0000 Subject: [PATCH] Allow '.', ':' and ',' as separators in OGM style chapter timestamps. Accounts for stupid user mistakes. --- src/common/chapters.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/common/chapters.cpp b/src/common/chapters.cpp index a190188c3..e7f5eeaed 100644 --- a/src/common/chapters.cpp +++ b/src/common/chapters.cpp @@ -35,10 +35,8 @@ string default_chapter_country; /** Is the current char an equal sign? */ #define isequal(s) (*(s) == '=') -/** Is the current char a colon? */ -#define iscolon(s) (*(s) == ':') -/** Is the current char a dot? */ -#define isdot(s) (*(s) == '.') +/** Is the current char a colon, comman or a dot? */ +#define isseparator(s) ((':' == *(s)) || (',' == *(s)) || ('.' == *(s))) /** Do we have two consecutive digits? */ #define istwodigits(s) (isdigit(*(s)) && isdigit(*(s + 1))) /** Do we have three consecutive digits? */ @@ -53,11 +51,11 @@ string default_chapter_country; istwodigits(s + 7) && \ isequal(s + 9) && \ istwodigits(s + 10) && \ - iscolon(s + 12) && \ + isseparator(s + 12) && \ istwodigits(s + 13) && \ - iscolon(s + 15) && \ + isseparator(s + 15) && \ istwodigits(s + 16) && \ - isdot(s + 18) && \ + isseparator(s + 18) && \ isthreedigits(s + 19)) /** Does \c s point to a valid OGM style chapter name entry? */ #define ischapternameline(s) ((strlen(s) >= 15) && \