Commit 8ad9a12b authored by Josh Coalson's avatar Josh Coalson

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

parent 116ca67f
......@@ -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>
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment