mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-25 23:21:15 -03:00
Migrate invalidate_numeric_locale into fish_setlocale
Centralizes where locale information is recomputed.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
use crate::global_safety::RelaxedAtomicBool;
|
||||
use crate::key;
|
||||
use crate::libc::MB_CUR_MAX;
|
||||
use crate::locale::invalidate_numeric_locale;
|
||||
use crate::parse_util::parse_util_escape_string_with_quote;
|
||||
use crate::terminal::Output;
|
||||
use crate::termsize::Termsize;
|
||||
@@ -1278,6 +1279,9 @@ pub fn should_suppress_stderr_for_tests() -> bool {
|
||||
/// This function should be called after calling `setlocale()` to perform fish specific locale
|
||||
/// initialization.
|
||||
pub fn fish_setlocale() {
|
||||
// Invalidate the cached numeric locale.
|
||||
invalidate_numeric_locale();
|
||||
|
||||
// Helper to make a static reference to a static &'wstr, from a string literal.
|
||||
// This is necessary to store them in global atomics, as these can't handle fat pointers.
|
||||
macro_rules! LL {
|
||||
|
||||
@@ -575,8 +575,7 @@ fn init_locale(vars: &EnvStack) {
|
||||
// should never fail, the C locale should always be defined
|
||||
assert_ne!(loc_ptr, ptr::null_mut());
|
||||
|
||||
// See that we regenerate our special locale for numbers
|
||||
crate::locale::invalidate_numeric_locale();
|
||||
// Update cached locale information.
|
||||
crate::common::fish_setlocale();
|
||||
FLOG!(
|
||||
env_locale,
|
||||
|
||||
Reference in New Issue
Block a user