diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-03-22 17:56:10 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-03-22 17:56:10 +0000 |
| commit | 0632a3c2e4474014a6c081b87c253cc55d7c2109 (patch) | |
| tree | d4a265c5220c42fc69e6787b432c8e35883b94c2 /misc.c | |
| parent | 6dac51795e5672f32bba787c0f011cb01e464a96 (diff) | |
| download | puzzles-0632a3c2e4474014a6c081b87c253cc55d7c2109.zip puzzles-0632a3c2e4474014a6c081b87c253cc55d7c2109.tar.gz puzzles-0632a3c2e4474014a6c081b87c253cc55d7c2109.tar.bz2 puzzles-0632a3c2e4474014a6c081b87c253cc55d7c2109.tar.xz | |
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.
Diffstat (limited to 'misc.c')
| -rw-r--r-- | misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |