From feacac89fecf48c2ed3111995cb74d39bcdc60bf Mon Sep 17 00:00:00 2001 From: michelerenzullo Date: Mon, 29 Mar 2021 18:00:41 +0200 Subject: [PATCH] fixed case in filename extension inside directory --- XMPConverter/XMPconverter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XMPConverter/XMPconverter.cpp b/XMPConverter/XMPconverter.cpp index dc4ac06..cef18d0 100644 --- a/XMPConverter/XMPconverter.cpp +++ b/XMPConverter/XMPconverter.cpp @@ -118,10 +118,10 @@ void read_directory(const string& name, std::vector& v) { while ((dp = readdir(dirp)) != NULL) { char* check_extension; if (check_extension = strrchr(dp->d_name, '.')) { - for (uint32 i = 0; i < strlen(check_extension); ++i) - check_extension[i] = tolower(check_extension[i]); + string filename = dp->d_name; + for (uint32 i = 0; i < strlen(check_extension); ++i) check_extension[i] = tolower(check_extension[i]); if (check_extension != NULL && (strcmp(check_extension, ".cube") == 0 xor strcmp(check_extension, ".xmp") == 0)) - v.push_back(name + "/" + string(dp->d_name)); + v.push_back(name + "/" + filename); } } closedir(dirp);