fix a problem with fractional-second parsing for --skip/--until in some locales (SF #1031043)

This commit is contained in:
Josh Coalson 2006-11-14 06:29:13 +00:00
parent 116ca67f28
commit 8ad9a12b03
2 changed files with 5 additions and 4 deletions

View File

@ -112,6 +112,7 @@
<li>Fixed a bug where WAVE files with "data" subchunks of size 0 where accepted (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1293830&amp;group_id=13478&amp;atid=113478">SF #1293830</a>).</li>
<li>Fixed a bug where sync error at end-of-stream of truncated files was not being caught (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1244071&amp;group_id=13478&amp;atid=113478">SF #1244071</a>).</li>
<li>Fixed a problem with filename parsing if file does not have extension but also has a . in the path (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1161916&amp;group_id=13478&amp;atid=113478">SF #1161916</a>).</li>
<li>Fixed a problem with fractional-second parsing for <span class="argument">--skip</span>/<span class="argument">--until</span> in some locales (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1031043&amp;group_id=13478&amp;atid=113478">SF #1031043</a>).</li>
<li>Increase progress report rate when -p and -e are used together (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1580122&amp;group_id=13478&amp;atid=113478">SF #1580122</a>).</li>
</ul>
</li>

View File

@ -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);