Skip to content
Snippets Groups Projects
Commit 063216ef authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Allow psql booleans to use OFF or off.

Michael Paesold
parent 8613eac6
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2004, PostgreSQL Global Development Group * Copyright (c) 2000-2004, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/variables.c,v 1.18 2004/08/29 04:13:03 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/variables.c,v 1.19 2004/10/15 05:02:31 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "common.h" #include "common.h"
...@@ -51,12 +51,12 @@ GetVariableBool(VariableSpace space, const char *name) ...@@ -51,12 +51,12 @@ GetVariableBool(VariableSpace space, const char *name)
val = GetVariable(space, name); val = GetVariable(space, name);
if (val == NULL) if (val == NULL)
return false; /* not set -> assume "off" */ return false; /* not set -> assume "off" */
if (strcmp(val, "off") == 0) if (strcasecmp(val, "off") == 0)
return false; return false; /* accept "off" or "OFF" as true */
/* /*
* for backwards compatibility, anything except "off" is taken as * for backwards compatibility, anything except "off" or "OFF" is
* "true" * taken as "true"
*/ */
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment