1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 04:50:22 +00:00

Update func__files() to handle fileSpec directory name without trailing slash

This commit is contained in:
Samuel Gomes 2023-12-29 01:17:05 +05:30
parent 85afb4b84a
commit 35e44a620d

View file

@ -643,8 +643,12 @@ qbs *func__files(qbs *qbsFileSpec, int32_t passed) {
// Check if fresh arguments were passed and we need to begin a new session
if (passed) {
std::string fileSpec(reinterpret_cast<char *>(qbsFileSpec->chr), qbsFileSpec->len);
filepath_fix_directory(fileSpec);
filepath_split(fileSpec, directory, pathName); // split the file path
if (FS_DirectoryExists(filepath_fix_directory(fileSpec)))
directory = fileSpec;
else
filepath_split(fileSpec, directory, pathName); // split the file path
entry = FS_GetDirectoryEntryName(fileSpec.c_str());
if (FS_IsStringEmpty(entry)) {