From: Josh Coalson Date: Tue, 14 Nov 2006 06:29:13 +0000 (+0000) Subject: fix a problem with fractional-second parsing for --skip/--until in some locales ... X-Git-Tag: 1.2.0~292 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ad9a12b0337937ea961d4a51202dbe6e54b41c0;p=platform%2Fupstream%2Fflac.git fix a problem with fractional-second parsing for --skip/--until in some locales (SF #1031043) --- diff --git a/doc/html/changelog.html b/doc/html/changelog.html index 29b7f93..120ddd8 100644 --- a/doc/html/changelog.html +++ b/doc/html/changelog.html @@ -112,6 +112,7 @@
  • Fixed a bug where WAVE files with "data" subchunks of size 0 where accepted (SF #1293830).
  • Fixed a bug where sync error at end-of-stream of truncated files was not being caught (SF #1244071).
  • Fixed a problem with filename parsing if file does not have extension but also has a . in the path (SF #1161916).
  • +
  • Fixed a problem with fractional-second parsing for --skip/--until in some locales (SF #1031043).
  • Increase progress report rate when -p and -e are used together (SF #1580122).
  • diff --git a/src/flac/utils.c b/src/flac/utils.c index 15d715a..ea5c317 100644 --- a/src/flac/utils.c +++ b/src/flac/utils.c @@ -71,12 +71,12 @@ static FLAC__bool local__parse_timecode_(const char *s, double *value) } ret = (double)i * 60.; - /* parse [0-9]*[.]?[0-9]* i.e. a sign-less rational number */ - if(strspn(s, "1234567890.") != strlen(s)) + /* parse [0-9]*[.,]?[0-9]* i.e. a sign-less rational number (. or , OK for fractional seconds, so support different locales) */ + if(strspn(s, "1234567890.,") != strlen(s)) return false; { - const char *p = strchr(s, '.'); - if(p && 0 != strchr(++p, '.')) + const char *p = strpbrk(s, ".,"); + if(p && 0 != strpbrk(++p, ".,")) return false; } ret += atof(s);