mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
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)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user