diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c index d95b74f6..5c493f7e 100644 --- a/src/share/grabbag/cuesheet.c +++ b/src/share/grabbag/cuesheet.c @@ -334,6 +334,7 @@ static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message, track->indices[track->num_indices-1].number = in_index_num; } else if(0 == FLAC__STRCASECMP(field, "ISRC")) { + char *l, *r; if(track_has_isrc) { *error_message = "found multiple ISRC commands"; return false; @@ -346,6 +347,12 @@ static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message, *error_message = "ISRC is missing ISRC number"; return false; } + /* strip out dashes */ + for(l = r = field; *r; r++) { + if(*r != '-') + *l++ = *r; + } + *l = '\0'; if(strlen(field) != 12 || strspn(field, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") < 5 || strspn(field+5, "1234567890") != 7) { *error_message = "invalid ISRC number"; return false; diff --git a/test/cuesheets/good.001.cue b/test/cuesheets/good.001.cue index f017a70e..f9887cfa 100644 --- a/test/cuesheets/good.001.cue +++ b/test/cuesheets/good.001.cue @@ -109,7 +109,7 @@ FILE "z.wav" WAVE INDEX 98 03:42:58 INDEX 99 03:42:59 TRACK 03 AUDIO - ISRC ABCD76543210 + ISRC AB-CD7-65-43210 INDEX 00 04:50:12 INDEX 01 04:51:72 TRACK 04 AUDIO