fix a problem with fractional-second parsing for --skip/--until in some locales ...
authorJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 14 Nov 2006 06:29:13 +0000 (06:29 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 14 Nov 2006 06:29:13 +0000 (06:29 +0000)
doc/html/changelog.html
src/flac/utils.c

index 29b7f93..120ddd8 100644 (file)
                                        <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>
index 15d715a..ea5c317 100644 (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);