aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-09 15:15:23 +0100
committergingerBill <bill@gingerbill.org>2024-07-09 15:15:23 +0100
commitd7016422939b3c4f0eeec4fb45796667655489cf (patch)
treeb8f9ec932e8c2adc76b2b5c53b9f1062bd8ef017 /src
parent4c1754b1dc3e13b0c1bb66c3859c4f7b2012b8cd (diff)
Check for `PROMPT`
Diffstat (limited to 'src')
-rw-r--r--src/cached.cpp17
1 files 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<String> const &args) {
@@ -244,15 +246,20 @@ gb_internal bool try_cached_build(Checker *c, Array<String> 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);