shithub: puzzles

Download patch

ref: 0632a3c2e4474014a6c081b87c253cc55d7c2109
parent: 6dac51795e5672f32bba787c0f011cb01e464a96
author: Ben Harris <bjh21@bjh21.me.uk>
date: Wed Mar 22 13:56:10 EDT 2023

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.

--- a/misc.c
+++ b/misc.c
@@ -202,7 +202,7 @@
 {
     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;
 }