Editor: fix bug of executable searching

This commit is contained in:
李通洲 committed 2024-08-23 13:51:45 +08:00
1 parent b4aac9d7d7
commit e199a2fb79
2 files changed
+27 -18

No files matched your search

+10 -7
View File
@@ -13,14 +13,17 @@ const char* ffFindExecutableInPath(const char* name, FFstrbuf* result)
const bool appendExe = !ffStrEndsWithIgnCase(name, ".exe");
#endif
for (char* token = NULL; (token = strchr(path,
#ifdef _WIN32
';'
#else
':'
#endif
)) != NULL; path = token + 1)
for (char* token = path; *token; path = token + 1)
{
token = strchr(path,
#ifdef _WIN32
';'
#else
':'
#endif
);
if (!token) token = path + strlen(path);
ffStrbufSetNS(result, (uint32_t)(token - path), path);
ffStrbufEnsureEndsWithC(result,
#ifdef _WIN32