From b413ea41c727a5afe1fbaffbb2c56d3f67b0db4a Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Fri, 10 Nov 2006 17:42:55 +0000 Subject: [PATCH] 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) --- src/flac/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/flac/main.c b/src/flac/main.c index 8f6c6c4d..48364e59 100644 --- a/src/flac/main.c +++ b/src/flac/main.c @@ -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; } -- 2.34.1