Skip to content

Commit 063216e

Browse files
committed
Allow psql booleans to use OFF or off.
Michael Paesold
1 parent 8613eac commit 063216e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bin/psql/variables.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/variables.c,v 1.18 2004/08/29 04:13:03 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/variables.c,v 1.19 2004/10/15 05:02:31 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "common.h"
@@ -51,12 +51,12 @@ GetVariableBool(VariableSpace space, const char *name)
5151
val = GetVariable(space, name);
5252
if (val == NULL)
5353
return false; /* not set -> assume "off" */
54-
if (strcmp(val, "off") == 0)
55-
return false;
54+
if (strcasecmp(val, "off") == 0)
55+
return false; /* accept "off" or "OFF" as true */
5656

5757
/*
58-
* for backwards compatibility, anything except "off" is taken as
59-
* "true"
58+
* for backwards compatibility, anything except "off" or "OFF" is
59+
* taken as "true"
6060
*/
6161
return true;
6262
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy