diff options
| author | Andrew Dunstan | 2013-02-06 19:52:29 +0000 |
|---|---|---|
| committer | Andrew Dunstan | 2013-02-06 19:52:29 +0000 |
| commit | e1c1e2173248f39c1b15fca7b2a31ad7b5199ce7 (patch) | |
| tree | db58fc5d34d7812a88b144ce4f573fe74406e402 /src/bin | |
| parent | 5a1cd89f8f4a0bc13c85810de47d48bb6386ea89 (diff) | |
Enable building with Microsoft Visual Studio 2012.
Backpatch to release 9.2
Brar Piening and Noah Misch, reviewed by Craig Ringer.
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/initdb/initdb.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 1bba4268a5..b75d976856 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -935,14 +935,22 @@ find_matching_ts_config(const char *lc_type) /* * Convert lc_ctype to a language name by stripping everything after an - * underscore. Just for paranoia, we also stop at '.' or '@'. + * underscore (usual case) or a hyphen (Windows "locale name"; see + * comments at IsoLocaleName()). + * + * XXX Should ' ' be a stop character? This would select "norwegian" for + * the Windows locale "Norwegian (Nynorsk)_Norway.1252". If we do so, we + * should also accept the "nn" and "nb" Unix locales. + * + * Just for paranoia, we also stop at '.' or '@'. */ if (lc_type == NULL) langname = pg_strdup(""); else { ptr = langname = pg_strdup(lc_type); - while (*ptr && *ptr != '_' && *ptr != '.' && *ptr != '@') + while (*ptr && + *ptr != '_' && *ptr != '-' && *ptr != '.' && *ptr != '@') ptr++; *ptr = '\0'; } |
