From beca984e5f1c315d02064e69861be112f5a69b3d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 22 Sep 2006 21:39:58 +0000 Subject: Fix bugs in plpgsql and ecpg caused by assuming that isspace() would only return true for exactly the characters treated as whitespace by their flex scanners. Per report from Victor Snezhko and subsequent investigation. Also fix a passel of unsafe usages of functions, that is, ye olde char-vs-unsigned-char issue. I won't miss when we are finally able to stop using it. --- src/backend/utils/misc/guc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/misc/guc.c') diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 7f7ded9e6a5..9467e6412c6 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut . * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.351 2006/09/22 17:41:21 petere Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.352 2006/09/22 21:39:57 tgl Exp $ * *-------------------------------------------------------------------- */ @@ -6155,7 +6155,7 @@ assign_custom_variable_classes(const char *newval, bool doit, GucSource source) initStringInfo(&buf); while ((c = *cp++) != 0) { - if (isspace(c)) + if (isspace((unsigned char) c)) { if (symLen > 0) hasSpaceAfterToken = true; @@ -6173,7 +6173,7 @@ assign_custom_variable_classes(const char *newval, bool doit, GucSource source) continue; } - if (hasSpaceAfterToken || !isalnum(c)) + if (hasSpaceAfterToken || !isalnum((unsigned char) c)) { /* * Syntax error due to token following space after token or non -- cgit v1.2.3