Fix pattern substituion (found with bash3.2.57)

This commit is contained in:
2022-03-22 14:11:45 +01:00
parent ad0f7bd646
commit d20ef76316
2 changed files with 4 additions and 4 deletions

View File

@@ -169,7 +169,7 @@ rl::cleanpath() {
# Remove multiple /
while [[ "${work:-}" = *"//"* ]]; do
work="${work//'//'/'/'}"
work="${work/\/\///}"
done
info " rl::cleanpath result: ${work}"
@@ -191,7 +191,7 @@ rl::normalize() {
# Remove /./ and /.$ sequences.
rex_tmp='/\.(/|$)'
while [[ "$work" =~ $rex_tmp ]]; do
work="${work/"${BASH_REMATCH[0]}"/"${BASH_REMATCH[1]/$//}"}"
work="${work/${BASH_REMATCH[0]}/${BASH_REMATCH[1]/$//}}"
done
# Remove leading ./