From d7016422939b3c4f0eeec4fb45796667655489cf Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 9 Jul 2024 15:15:23 +0100 Subject: [PATCH] Check for `PROMPT` --- src/cached.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/cached.cpp b/src/cached.cpp index 2e5f838ef..37eac6924 100644 --- a/src/cached.cpp +++ b/src/cached.cpp @@ -183,7 +183,9 @@ gb_internal bool try_copy_executable_from_cache(void) { } - +#if !defined(GB_SYSTEM_WINDOWS) +extern char **environ; +#endif // returns false if different, true if it is the same gb_internal bool try_cached_build(Checker *c, Array const &args) { @@ -244,15 +246,20 @@ gb_internal bool try_cached_build(Checker *c, Array const &args) { if (string_starts_with(str, str_lit("CURR_DATE_TIME="))) { continue; } + if (string_starts_with(str, str_lit("PROMPT="))) { + continue; + } array_add(&envs, str); } - #elif defined(GB_SYSTEM_LINUX) + #else char **curr_env = environ; while (curr_env && *curr_env) { - array_add(&envs, make_string_c(*curr_env++)); + String str = make_string_c(*curr_env++); + if (string_starts_with(str, str_lit("PROMPT="))) { + continue; + } + array_add(&envs, str); } - #else - // TODO(bill): environment variables on all other platforms #endif } array_sort(envs, string_cmp);