diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-06-03 19:05:13 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-06-05 15:49:34 -0700 |
commit | 0b385f145ce6144b5812bd89fa8f73369bcbe57f (patch) | |
tree | 3d3b059af2e9a7efb6fe38e33ee1782b23e6167e /src/fish_key_reader.cpp | |
parent | 32a585a52b20687a1a16c45142da2261d28b7a27 (diff) |
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
Diffstat (limited to 'src/fish_key_reader.cpp')
-rw-r--r-- | src/fish_key_reader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp index 1c30c1db..89a6ee53 100644 --- a/src/fish_key_reader.cpp +++ b/src/fish_key_reader.cpp @@ -148,8 +148,7 @@ void setup_and_process_keys(bool continuous_mode) { is_interactive_session = 1; // by definition this is interactive set_main_thread(); setup_fork_guards(); - wsetlocale(LC_ALL, L"POSIX"); - program_name = L"fish_key_reader"; + setlocale(LC_ALL, "POSIX"); env_init(); reader_init(); input_init(); @@ -178,6 +177,7 @@ void setup_and_process_keys(bool continuous_mode) { } int main(int argc, char **argv) { + program_name = L"fish_key_reader"; bool continuous_mode = false; const char *short_opts = "+c"; const struct option long_opts[] = {{"continuous", no_argument, NULL, 'd'}, {NULL, 0, NULL, 0}}; |