Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28ec316

Browse files
committed
libpq code should use libpq_gettext(), not _()
Fix some wrong use and install a safeguard against future mistakes.
1 parent66af5ee commit28ec316

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎src/interfaces/libpq/fe-auth-scram.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ pg_fe_scram_build_secret(const char *password, const char **errstr)
922922
rc=pg_saslprep(password,&prep_password);
923923
if (rc==SASLPREP_OOM)
924924
{
925-
*errstr=_("out of memory");
925+
*errstr=libpq_gettext("out of memory");
926926
returnNULL;
927927
}
928928
if (rc==SASLPREP_SUCCESS)
@@ -931,7 +931,7 @@ pg_fe_scram_build_secret(const char *password, const char **errstr)
931931
/* Generate a random salt */
932932
if (!pg_strong_random(saltbuf,SCRAM_DEFAULT_SALT_LEN))
933933
{
934-
*errstr=_("could not generate random salt");
934+
*errstr=libpq_gettext("could not generate random salt");
935935
free(prep_password);
936936
returnNULL;
937937
}

‎src/interfaces/libpq/libpq-int.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,11 @@ extern char *libpq_ngettext(const char *msgid, const char *msgid_plural, unsigne
881881
#definelibpq_gettext(x) (x)
882882
#definelibpq_ngettext(s,p,n) ((n) == 1 ? (s) : (p))
883883
#endif
884+
/*
885+
* libpq code should use the above, not _(), since that would use the
886+
* surrounding programs's message catalog.
887+
*/
888+
#undef _
884889

885890
/*
886891
* These macros are needed to let error-handling code be portable between

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp