From 4c7036a2cef3ea8e84fd7388b3ad1661f38d4a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 29 Jun 2023 09:43:00 +0800 Subject: [PATCH] FFPlatform: fix ffPlatformPathAddEnv on Windows --- src/util/platform/FFPlatform.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/platform/FFPlatform.c b/src/util/platform/FFPlatform.c index 2a880aed1..811547c52 100644 --- a/src/util/platform/FFPlatform.c +++ b/src/util/platform/FFPlatform.c @@ -98,7 +98,13 @@ void ffPlatformPathAddEnv(FFlist* dirs, const char* env) uint32_t startIndex = 0; while (startIndex < value.length) { - uint32_t colonIndex = ffStrbufNextIndexC(&value, startIndex, ':'); + #ifdef _WIN32 + const char separator = ';'; + #else + const char separator = ':'; + #endif + + uint32_t colonIndex = ffStrbufNextIndexC(&value, startIndex, separator); value.chars[colonIndex] = '\0'; if(!ffStrSet(value.chars + startIndex))