simplify, and fix, setting the current locale

Fix test setup bogosities. Specifically, they weren't hermetic with respect to
locale env vars.

Rewrite the handling of locale vars to simplify the code and make it more like
the pattern most programs employ.

Fixes #3110
This commit is contained in:
Kurtis Rader
2016-06-03 19:05:13 -07:00
parent 32a585a52b
commit 0b385f145c
8 changed files with 77 additions and 87 deletions

View File

@@ -418,11 +418,12 @@ int main(int argc, char **argv) {
assert(ANY_SENTINAL >= WILDCARD_RESERVED_BASE && ANY_SENTINAL <= WILDCARD_RESERVED_END);
assert(R_SENTINAL >= INPUT_COMMON_BASE && R_SENTINAL <= INPUT_COMMON_END);
program_name = L"fish";
set_main_thread();
setup_fork_guards();
wsetlocale(LC_ALL, L"");
program_name = L"fish";
setlocale(LC_ALL, "");
fish_setlocale();
// struct stat tmp;
// stat("----------FISH_HIT_MAIN----------", &tmp);