mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
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 <ctype.h> functions, that is, ye olde char-vs-unsigned-char issue. I won't miss <ctype.h> when we are finally able to stop using it.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||
*
|
||||
* 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
|
||||
|
Reference in New Issue
Block a user