From 0632a3c2e4474014a6c081b87c253cc55d7c2109 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 22 Mar 2023 17:56:10 +0000 Subject: [PATCH] Treat environment variable values beginning with "T" as true So a value is true iff it begins with 'T', 't', 'Y', or 'y'. This is mostly so that naively converting JSON "true" to a string will work properly, but it should keep LISPers happy too. --- misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc.c b/misc.c index f18f17e..659de83 100644 --- a/misc.c +++ b/misc.c @@ -202,7 +202,7 @@ bool getenv_bool(const char *name, bool dflt) { char *env = getenv(name); if (env == NULL) return dflt; - if (env[0] == 'y' || env[0] == 'Y') return true; + if (strchr("yYtT", env[0])) return true; return false; }