mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
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.
This commit is contained in:
2
misc.c
2
misc.c
@ -202,7 +202,7 @@ bool getenv_bool(const char *name, bool dflt)
|
|||||||
{
|
{
|
||||||
char *env = getenv(name);
|
char *env = getenv(name);
|
||||||
if (env == NULL) return dflt;
|
if (env == NULL) return dflt;
|
||||||
if (env[0] == 'y' || env[0] == 'Y') return true;
|
if (strchr("yYtT", env[0])) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user