From f381e1227ad855148323c80b1b27b019acd6d377 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 19 Jul 2019 10:26:27 -0700 Subject: [PATCH] Add string::filename() before computing string::filenameExtension(). --- src/patch.cpp | 3 ++- src/plugin.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/patch.cpp b/src/patch.cpp index f8eb463d..3cfa849b 100644 --- a/src/patch.cpp +++ b/src/patch.cpp @@ -138,8 +138,9 @@ void PatchManager::saveAsDialog() { std::free(pathC); }); + // Append .vcv extension if no extension was given. std::string pathStr = pathC; - if (string::filenameExtension(pathStr).empty()) { + if (string::filenameExtension(string::filename(pathStr)) == "") { pathStr += ".vcv"; } diff --git a/src/plugin.cpp b/src/plugin.cpp index ed6ec303..a307ba96 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -247,7 +247,7 @@ static void extractPackages(std::string path) { std::string message; for (std::string packagePath : system::getEntries(path)) { - if (string::filenameExtension(packagePath) != "zip") + if (string::filenameExtension(string::filename(packagePath)) != "zip") continue; INFO("Extracting package %s", packagePath.c_str()); // Extract package