From eef59867da104e25c1ace9b14ba3b09376bea70a Mon Sep 17 00:00:00 2001 From: Arne de Bruijn Date: Sat, 25 May 2024 13:24:18 +0200 Subject: [PATCH] Fix virtualgcc for long PATH values Previously virtualgcc wouldn't find gcc.exe if the PATH environment variable was longer than 1023 characters. --- virtualgcc/virtualgcc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/virtualgcc/virtualgcc.cpp b/virtualgcc/virtualgcc.cpp index 428b33b..0931b76 100644 --- a/virtualgcc/virtualgcc.cpp +++ b/virtualgcc/virtualgcc.cpp @@ -503,8 +503,9 @@ bool FindGCC(char *path) { } bool FindGCCPath(char *gcc_bin_path) { - char path_value[1024]; - if (!GetEnvironmentVariable("PATH", path_value, 1024)) { + char *path_value; + path_value = getenv("PATH"); + if (!path_value) { return false; }