diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-03 20:45:40 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-03 20:45:40 +0000 |
| commit | a27b691e2903a886be640db801677f6f988d3793 (patch) | |
| tree | c68f25c9edef18954e9c5b3d74893f1df87b8871 /src/bin/psql/tab-complete.c | |
| parent | 4d2a506526ceacab5f75df040596a5287ab40612 (diff) | |
Ensure that all uses of <ctype.h> functions are applied to unsigned-char
values, whether the local char type is signed or not. This is necessary
for portability. Per discussion on pghackers around 9/16/00.
Diffstat (limited to 'src/bin/psql/tab-complete.c')
| -rw-r--r-- | src/bin/psql/tab-complete.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index f519b460b45..9feb9055a97 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.23 2000/12/03 14:36:47 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.24 2000/12/03 20:45:38 tgl Exp $ */ /*---------------------------------------------------------------------- @@ -50,7 +50,7 @@ /* If we don't have this, we might as well forget about the whole thing: */ #ifdef USE_READLINE -#include <ctype.h> /* toupper */ +#include <ctype.h> #ifdef USE_ASSERT_CHECKING #include <assert.h> #endif @@ -440,7 +440,8 @@ psql_completion(char *text, int start, int end) /* Complete "AS ON <sth with a 'T' :)>" with a "TO" */ else if (strcasecmp(prev3_wd, "AS") == 0 && strcasecmp(prev2_wd, "ON") == 0 && - (toupper(prev_wd[4]) == 'T' || toupper(prev_wd[5]) == 'T')) + (toupper((unsigned char) prev_wd[4]) == 'T' || + toupper((unsigned char) prev_wd[5]) == 'T')) COMPLETE_WITH_CONST("TO"); /* Complete "AS ON <sth> TO" with a table name */ else if (strcasecmp(prev4_wd, "AS") == 0 && |
