From: Tom Lane Date: Mon, 25 Jul 2005 04:52:32 +0000 (+0000) Subject: Awhile back we replaced all uses of strcasecmp and strncasecmp with X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=7ad1401d9f75d61aaac9b11bfda387bff04a4922;p=users%2Fbernd%2Fpostgres.git 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. --- diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 020fcff349..71a5856ef0 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -234,7 +234,7 @@ pg_krb5_recvauth(Port *port) kusername = pg_an_to_ln(kusername); if (pg_krb_caseins_users) - ret = strncasecmp(port->user_name, kusername, SM_DATABASE_USER); + ret = pg_strncasecmp(port->user_name, kusername, SM_DATABASE_USER); else ret = strncmp(port->user_name, kusername, SM_DATABASE_USER); if (ret) diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 861c35719a..3c3bf5477e 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -829,7 +829,7 @@ check_encodings_match(int pg_enc, const char *ctype) for (i = 0; encoding_match_list[i].system_enc_name; i++) { if (pg_enc == encoding_match_list[i].pg_enc_code - && strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0) + && pg_strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0) { free(sys); return; @@ -860,7 +860,7 @@ find_matching_encoding(const char *ctype) for (i = 0; encoding_match_list[i].system_enc_name; i++) { - if (strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0) + if (pg_strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0) { free(sys); return encoding_match_list[i].pg_enc_code; diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 1174d4706a..5d0baaed23 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -911,7 +911,7 @@ pgwin32_CommandLine(bool registration) if (registration) { - if (strcasecmp(cmdLine + strlen(cmdLine) - 4, ".exe")) + if (pg_strcasecmp(cmdLine + strlen(cmdLine) - 4, ".exe")) { /* If commandline does not end in .exe, append it */ strcat(cmdLine, ".exe"); diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 5a1360ecba..c9fab160ed 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -828,8 +828,8 @@ makeAlterConfigCommand(const char *arrayitem, const char *type, const char *name * Some GUC variable names are 'LIST' type and hence must not be * quoted. */ - if (strcasecmp(mine, "DateStyle") == 0 - || strcasecmp(mine, "search_path") == 0) + if (pg_strcasecmp(mine, "DateStyle") == 0 + || pg_strcasecmp(mine, "search_path") == 0) appendPQExpBuffer(buf, "%s", pos + 1); else appendStringLiteral(buf, pos + 1, false);