Commit b413ea41 authored by Josh Coalson's avatar Josh Coalson
Browse files

fix problem with filename parsing if file does not have extension but also has...

fix problem with filename parsing if file does not have extension but also has a . in the path (SF#1161916 http://sourceforge.net/tracker/index.php?func=detail&aid=1161916&group_id=13478&atid=113478)
parent cc190e83
......@@ -1905,7 +1905,8 @@ const char *get_outfilename(const char *infilename, const char *suffix)
return 0;
if (flac__strlcat(buffer, infilename, sizeof buffer) >= sizeof buffer)
return 0;
if(0 == (p = strrchr(buffer, '.'))) {
/* the . must come after any / to avoid problems with, e.g. "some.directory/extensionless-filename" */
if(0 == (p = strrchr(buffer, '.')) || strchr(p, '/')) {
if (flac__strlcat(buffer, suffix, sizeof buffer) >= sizeof buffer)
return 0;
}
......
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