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

Commit 4a2972d

Browse files
committed
Awhile back we replaced all uses of strcasecmp and strncasecmp with
pg_strcasecmp and pg_strncasecmp ... but I see some of the former have crept back in. Eternal vigilance is the price of locale independence, apparently.
1 parent cb504a4 commit 4a2972d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/backend/libpq/auth.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.126 2005/06/27 02:04:24 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.127 2005/07/25 04:52:31 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -234,7 +234,7 @@ pg_krb5_recvauth(Port *port)
234234

235235
kusername = pg_an_to_ln(kusername);
236236
if (pg_krb_caseins_users)
237-
ret = strncasecmp(port->user_name, kusername, SM_DATABASE_USER);
237+
ret = pg_strncasecmp(port->user_name, kusername, SM_DATABASE_USER);
238238
else
239239
ret = strncmp(port->user_name, kusername, SM_DATABASE_USER);
240240
if (ret)

src/bin/initdb/initdb.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.92 2005/07/10 16:13:12 momjian Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.93 2005/07/25 04:52:31 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -829,7 +829,7 @@ check_encodings_match(int pg_enc, const char *ctype)
829829
for (i = 0; encoding_match_list[i].system_enc_name; i++)
830830
{
831831
if (pg_enc == encoding_match_list[i].pg_enc_code
832-
&& strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0)
832+
&& pg_strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0)
833833
{
834834
free(sys);
835835
return;
@@ -860,7 +860,7 @@ find_matching_encoding(const char *ctype)
860860

861861
for (i = 0; encoding_match_list[i].system_enc_name; i++)
862862
{
863-
if (strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0)
863+
if (pg_strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0)
864864
{
865865
free(sys);
866866
return encoding_match_list[i].pg_enc_code;

src/bin/pg_ctl/pg_ctl.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.59 2005/07/10 16:13:13 momjian Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.60 2005/07/25 04:52:32 tgl Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -911,7 +911,7 @@ pgwin32_CommandLine(bool registration)
911911

912912
if (registration)
913913
{
914-
if (strcasecmp(cmdLine + strlen(cmdLine) - 4, ".exe"))
914+
if (pg_strcasecmp(cmdLine + strlen(cmdLine) - 4, ".exe"))
915915
{
916916
/* If commandline does not end in .exe, append it */
917917
strcat(cmdLine, ".exe");

src/bin/pg_dump/pg_dumpall.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.64 2005/07/18 19:12:09 tgl Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.65 2005/07/25 04:52:32 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -828,8 +828,8 @@ makeAlterConfigCommand(const char *arrayitem, const char *type, const char *name
828828
* Some GUC variable names are 'LIST' type and hence must not be
829829
* quoted.
830830
*/
831-
if (strcasecmp(mine, "DateStyle") == 0
832-
|| strcasecmp(mine, "search_path") == 0)
831+
if (pg_strcasecmp(mine, "DateStyle") == 0
832+
|| pg_strcasecmp(mine, "search_path") == 0)
833833
appendPQExpBuffer(buf, "%s", pos + 1);
834834
else
835835
appendStringLiteral(buf, pos + 1, false);

0 commit comments

Comments
 (0)