From cda8298144adfd4c527184bc4e13715837d76f59 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 16 Jul 2024 09:58:56 +0200 Subject: [PATCH] libstd.bash: in std::replace_path(): use empty string as default forreplacestr --- Pmodules/libstd.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pmodules/libstd.bash b/Pmodules/libstd.bash index d3b9b0c..65c2a0f 100644 --- a/Pmodules/libstd.bash +++ b/Pmodules/libstd.bash @@ -152,7 +152,7 @@ std::remove_path() { std::replace_path () { local -r path="$1" local -r removepat="$2" - local -r replacestr="$3" + local -r replacestr="${3:-''}" local -r removestr=$(echo "${!path}" | tr ":" "\n" | grep -m 1 "^$removepat\$") export $path="$(echo "${!path}" | tr ":" "\n" | sed "s:^${removestr}\$:${replacestr}:" |