Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5a5cb30

Browse files
committed
Fix tolower loops to go in proper direction for cache.
1 parent 84fc5c4 commit 5a5cb30

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/backend/commands/define.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.18 1997/11/26 04:50:28 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.19 1997/12/05 01:12:40 momjian Exp $
1313
*
1414
* DESCRIPTION
1515
* The "DefineFoo" routines take the parse tree and pick out the
@@ -69,7 +69,7 @@ case_translate_language_name(const char *input, char *output)
6969
--------------------------------------------------------------------------*/
7070
int i;
7171

72-
for (i = 0; i < NAMEDATALEN && input[i] != '\0'; ++i)
72+
for (i = 0; i < NAMEDATALEN && input[i]; ++i)
7373
output[i] = tolower(input[i]);
7474

7575
output[i] = '\0';

src/backend/commands/proclang.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ case_translate_language_name(const char *input, char *output)
2828
--------------------------------------------------------------------------*/
2929
int i;
3030

31-
for (i = 0; i < NAMEDATALEN && input[i] != '\0'; ++i)
31+
for (i = 0; i < NAMEDATALEN && input[i]; ++i)
3232
output[i] = tolower(input[i]);
3333

3434
output[i] = '\0';

src/backend/parser/scan.l

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.31 1997/11/30 23:05:36 thomas Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.32 1997/12/05 01:12:53 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -355,7 +355,7 @@ other .
355355
int i;
356356
ScanKeyword *keyword;
357357

358-
for(i = strlen(yytext); i >= 0; i--)
358+
for(i = 0; yytext[i]; i++)
359359
if (isupper(yytext[i]))
360360
yytext[i] = tolower(yytext[i]);
361361

src/bin/psql/psql.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.118 1997/11/30 17:46:01 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.119 1997/12/05 01:13:11 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -558,7 +558,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
558558
}
559559
else
560560
{
561-
for (i = strlen(table); i >= 0; i--)
561+
for (i = 0; table[i]; i++)
562562
if (isupper(table[i]))
563563
table[i] = tolower(table[i]);
564564
}
@@ -708,7 +708,7 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout)
708708
}
709709
else
710710
{
711-
for (i = strlen(object); i >= 0; i--)
711+
for (i = 0; object[i]; i++)
712712
if (isupper(object[i]))
713713
object[i] = tolower(object[i]);
714714
}

src/interfaces/libpq/fe-connect.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.52 1997/12/04 20:32:35 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.53 1997/12/05 01:13:21 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -444,7 +444,7 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions, cons
444444
*(conn->dbName + strlen(conn->dbName) - 1) = '\0';
445445
}
446446
else
447-
for (i = strlen(conn->dbName); i >= 0; i--)
447+
for (i = 0; conn->dbName[i]; i++)
448448
if (isupper(conn->dbName[i]))
449449
conn->dbName[i] = tolower(conn->dbName[i]);
450450
}

src/interfaces/libpq/fe-exec.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.43 1997/12/04 23:28:20 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.44 1997/12/05 01:13:24 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1697,7 +1697,7 @@ PQfnumber(PGresult *res, const char *field_name)
16971697
*(field_case + strlen(field_case) - 1) = '\0';
16981698
}
16991699
else
1700-
for (i = 0; i < strlen(field_case); i++)
1700+
for (i = 0; field_case[i]; i++)
17011701
if (isupper(field_case[i]))
17021702
field_case[i] = tolower(field_case[i]);
17031703

0 commit comments

Comments
 (0)