mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-30 19:29:38 +02:00
Merge branch 'cherry-pick-e0841bce' into 'master'
Merge branch '386-libstd-bugs-in-std-append_path-and-std-prepend_path' into '1.1.22' See merge request Pmodules/src!413
This commit is contained in:
@@ -285,6 +285,7 @@ std::append_path () {
|
||||
[[ "${path}" == @(|*:)${dir}@(|:*) ]] && continue
|
||||
dirs+="${dir}:"
|
||||
done
|
||||
[[ -n "${dirs}" ]] || return 0
|
||||
|
||||
# assemble new path
|
||||
dirs="${dirs%:}" # remove leading ':'
|
||||
@@ -308,12 +309,13 @@ std::prepend_path () {
|
||||
[[ "${path}" == @(|*:)${dir}@(|:*) ]] && continue
|
||||
dirs+="${dir}:"
|
||||
done
|
||||
[[ -n "${dirs}" ]] || return 0
|
||||
|
||||
# assemble new path
|
||||
dirs="${dirs%:}" # remove leading ':'
|
||||
if [[ -z ${path} ]]; then
|
||||
path="${dirs}"
|
||||
else
|
||||
else
|
||||
path="${dirs}:${path}"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user