瀏覽代碼

Merge pull request #4922 from Bigfoot71/review-file-dir-2

[rcore] Some adjustments for `FilePathList`
pull/4924/head
Ray 3 天之前
committed by GitHub
父節點
當前提交
31d63d08e2
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 1 個檔案被更改,包括 6 行新增3 行删除
  1. +6
    -3
      src/rcore.c

+ 6
- 3
src/rcore.c 查看文件

@ -2314,9 +2314,12 @@ FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool
// WARNING: files.count is not reseted to 0 after unloading
void UnloadDirectoryFiles(FilePathList files)
{
for (unsigned int i = 0; i < files.capacity; i++) RL_FREE(files.paths[i]);
if (files.paths != NULL)
{
for (unsigned int i = 0; i < files.capacity; i++) RL_FREE(files.paths[i]);
RL_FREE(files.paths);
RL_FREE(files.paths);
}
}
// Create directories (including full path requested), returns 0 on success
@ -3738,7 +3741,7 @@ static void ScanDirectoryFiles(const char *basePath, FilePathList *files, const
// Scan all files and directories recursively from a base path
static void ScanDirectoryFilesRecursively(const char *basePath, FilePathList *files, const char *filter)
{
char path[MAX_FILEPATH_LENGTH] = { 0 };
">static char path[MAX_FILEPATH_LENGTH] = { 0 };
memset(path, 0, MAX_FILEPATH_LENGTH);
struct dirent *dp = NULL;

Loading…
取消
儲存