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/bin/pg_dump/pg_dump.c | 6 +++--- src/bin/psql/tab-complete.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/bin') diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 78a653fb48..fbf131f577 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -12,7 +12,7 @@ * by PostgreSQL * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.447 2006/08/21 00:57:25 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.448 2006/09/22 21:39:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -367,10 +367,10 @@ main(int argc, char **argv) new_obj_name->next = NULL; new_obj_name->name = strdup(optarg); - new_obj_name->is_include = islower(c) ? true : false; + new_obj_name->is_include = islower((unsigned char) c) ? true : false; /* add new entry to the proper list */ - if (tolower(c) == 'n') + if (tolower((unsigned char) c) == 'n') { if (!schemaList_tail) schemaList_tail = schemaList = new_obj_name; diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index f8edb78b57..64b9576a66 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.154 2006/07/14 14:52:27 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.155 2006/09/22 21:39:57 tgl Exp $ */ /*---------------------------------------------------------------------- @@ -1090,8 +1090,8 @@ psql_completion(char *text, int start, int end) /* Complete "AS ON " with a "TO" */ else if (pg_strcasecmp(prev3_wd, "AS") == 0 && pg_strcasecmp(prev2_wd, "ON") == 0 && - (toupper((unsigned char) prev_wd[4]) == 'T' || - toupper((unsigned char) prev_wd[5]) == 'T')) + (pg_toupper((unsigned char) prev_wd[4]) == 'T' || + pg_toupper((unsigned char) prev_wd[5]) == 'T')) COMPLETE_WITH_CONST("TO"); /* Complete "AS ON TO" with a table name */ else if (pg_strcasecmp(prev4_wd, "AS") == 0 && -- cgit v1.2.1