Compatibility to bash 3 #2

Merged
efelon merged 3 commits from dev into main 2022-03-22 14:34:20 +01:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit d20ef76316 - Show all commits

View File

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

View File

@@ -47,7 +47,7 @@ rl::printPath() {
local inputwidth=${config_path_width} local inputwidth=${config_path_width}
if (( flag_extendedOutput )); then if (( flag_extendedOutput )); then
printf -- "%-3d Inp: %-${config_path_width}s ---" ${testnum} "${input}" printf -- "%-5d Inp: %-${config_path_width}s ---" ${testnum} "${input}"
else else
# Truncate input string on the left if longer than $config_path_width # Truncate input string on the left if longer than $config_path_width
if (( ${#input} > ${config_path_width} )) ; then if (( ${#input} > ${config_path_width} )) ; then