mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 20:21:16 -03:00
Remove support for elf-patching LOCALEDIR
Commit bf65b9e3a7 (Change `gettext` paths to be relocatable (#11195),
2025-03-30) is difficult to follow because it combines code movement with
two behavior changes. Our parent commit fixed the first behavior change.
The second behavior change made us tolerate trailing NUL bytes in LOCALEDIR.
This was motivated because conda wants to use binary patching to change
the effective prefix at runtime, presumably so the user can move around the
"fish" executable program arbitraily.
This turned out to be unnecessary because fish is already "relocatable"
(see our parent commit).
Let's remove the special case for LOCALEDIR. Treat it like other paths.
Closes #11574
Closes #11474
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
use std::ffi::CString;
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
use std::sync::Mutex;
|
||||
|
||||
use crate::common::{charptr2wcstring, wcs2zstring, PACKAGE_NAME};
|
||||
@@ -52,9 +53,7 @@ fn wgettext_really_init() {
|
||||
return;
|
||||
};
|
||||
let package_name = CString::new(PACKAGE_NAME).unwrap();
|
||||
// This contains `datadir`; which when replaced to make the binary relocatable,
|
||||
// causes null bytes at the end of the string.
|
||||
let localedir = CString::new(localepath.display().to_string()).unwrap();
|
||||
let localedir = CString::new(localepath.as_os_str().as_bytes()).unwrap();
|
||||
fish_bindtextdomain(&package_name, &localedir);
|
||||
fish_textdomain(&package_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user