termux-packages/packages/kibi/fsh-path-replacement.patch

26 lines
1.1 KiB
Diff

--- a/src/unix.rs
+++ b/src/unix.rs
@@ -28,7 +28,7 @@
// If environment variable `home_key` (e.g. `$XDG_CONFIG_HOME`) is set, add its value to `dirs`.
// Otherwise, if environment variable `$HOME` is set, add `$HOME{def_home_suffix}`
// (e.g. `$HOME/.config`) to `dirs`.
- dirs.extend(var(home_key).or_else(|_| var("HOME").map(|d| d + def_home_suffix)).into_iter());
+ dirs.push(var(home_key).unwrap_or(format!("@TERMUX_HOME@{}", def_home_suffix)));
// If environment variable `dirs_key` (e.g. `XDG_CONFIG_DIRS`) is set, split by `:` and add the
// parts to `dirs`.
@@ -39,11 +39,11 @@
}
/// Return configuration directories for UNIX systems
-pub fn conf_dirs() -> Vec<String> { xdg_dirs("CONFIG", "/.config", "/etc/xdg:/etc") }
+pub fn conf_dirs() -> Vec<String> { xdg_dirs("CONFIG", "/.config", "@TERMUX_PREFIX@/etc") }
/// Return syntax directories for UNIX systems
pub fn data_dirs() -> Vec<String> {
- xdg_dirs("DATA", "/.local/share", "/usr/local/share/:/usr/share/")
+ xdg_dirs("DATA", "/.local/share", "@TERMUX_PREFIX@/share/")
}
/// Return the current window size as (rows, columns).