From 1a4de84b1f30f9c49b4c2541e73f269ec6410401 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 24 May 2020 12:45:14 +0200 Subject: [PATCH] Fix fakename streamfile for extensionless names --- src/streamfile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/streamfile.c b/src/streamfile.c index 6ce0626a..f6a98321 100644 --- a/src/streamfile.c +++ b/src/streamfile.c @@ -680,9 +680,12 @@ STREAMFILE* open_fakename_streamfile(STREAMFILE *streamfile, const char *fakenam } if (fakeext) { - char * ext = strrchr(this_sf->fakename,'.'); - if (ext != NULL) + char* ext = strrchr(this_sf->fakename,'.'); + if (ext != NULL) { ext[1] = '\0'; /* truncate past dot */ + } else { + strcat(this_sf->fakename, "."); /* no extension = add dot */ + } strcat(this_sf->fakename, fakeext); }