git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 760c770)
Fix potential coredump on bad locale value in pg_upgrade.
2014年1月30日 23:10:01 +0000 (18:10 -0500)
2014年1月30日 23:10:24 +0000 (18:10 -0500)
Thinko in error report (and a typo in the message text, too). We're
failing anyway, but it would be good to print something useful first.
Noted while reviewing a patch to make pg_upgrade's locale code laxer.


diff --git a/contrib/pg_upgrade/check.c b/contrib/pg_upgrade/check.c
index a706708f4d291eea6fe696e0070441baacdbfcb0..e395c7c7f629694328d88912d51b473c07df1721 100644 (file)
--- a/contrib/pg_upgrade/check.c
+++ b/contrib/pg_upgrade/check.c
@@ -990,6 +990,7 @@ get_canonical_locale_name(int category, const char *locale)
char *save;
char *res;
+ /* get the current setting, so we can restore it. */
save = setlocale(category, NULL);
if (!save)
pg_fatal("failed to get the current locale\n");
@@ -1001,7 +1002,7 @@ get_canonical_locale_name(int category, const char *locale)
res = setlocale(category, locale);
if (!res)
- pg_fatal("failed to get system local name for \"%s\"\n", res);
+ pg_fatal("failed to get system locale name for \"%s\"\n", locale);
res = pg_strdup(res);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /