diff options
author | Josh Coalson <jcoalson@users.sourceforce.net> | 2004-07-19 06:36:26 +0000 |
---|---|---|
committer | Josh Coalson <jcoalson@users.sourceforce.net> | 2004-07-19 06:36:26 +0000 |
commit | a175043b3fc69e87155263865c6c6cca9bad4498 (patch) | |
tree | bedfe78282d41586afcd3b51fda0955ce9d9b875 /src/share | |
parent | 12d7fcb8d9024f2932411f4d5ce13ecb6bfa1936 (diff) | |
download | flac-a175043b3fc69e87155263865c6c6cca9bad4498.tar.gz |
fix bug #896057: parsing ISRC number from cuesheet
Diffstat (limited to 'src/share')
-rw-r--r-- | src/share/grabbag/cuesheet.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |