From b78910ad9efa514685dfd9e9c829949387422ec9 Mon Sep 17 00:00:00 2001 From: Joachim Ansorg Date: Mon, 30 Dec 2024 18:01:32 +0100 Subject: [PATCH] Quote a few more file paths --- lib/file.sh | 4 ++-- lib/filecache.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/file.sh b/lib/file.sh index 8eb667e..24c6d41 100644 --- a/lib/file.sh +++ b/lib/file.sh @@ -24,8 +24,8 @@ typeset -a _Dbg_dir _Dbg_dir=('\$cdir' '\$cwd' ) # _Dbg_cdir is the directory in which the script is located. -[[ -z ${_Dbg_cdir} ]] && typeset _Dbg_cdir=${_Dbg_source_file%/*} -[[ -z ${_Dbg_cdir} ]] && typeset _Dbg_cdir=$(pwd) +[[ -z ${_Dbg_cdir} ]] && typeset _Dbg_cdir="${_Dbg_source_file%/*}" +[[ -z ${_Dbg_cdir} ]] && typeset _Dbg_cdir="$(pwd)" # Either fill out or strip filename as determined by "basename_only" # and annotate settings diff --git a/lib/filecache.sh b/lib/filecache.sh index 5c99b04..bf9e557 100644 --- a/lib/filecache.sh +++ b/lib/filecache.sh @@ -139,14 +139,14 @@ function _Dbg_is_file { if [[ ${find_file:0:1} == '/' ]] ; then # Absolute file name - try_find_file=$(_Dbg_expand_filename "$find_file") + try_find_file="$(_Dbg_expand_filename "$find_file")" if [[ -n ${_Dbg_filenames[$try_find_file]} ]] ; then echo "$try_find_file" return 0 fi elif [[ ${find_file:0:1} == '.' ]] ; then # Relative file name - try_find_file=$(_Dbg_expand_filename "${_Dbg_init_cwd}/$find_file") + try_find_file="$(_Dbg_expand_filename "${_Dbg_init_cwd}/$find_file")" # FIXME: turn into common subroutine if [[ -n ${_Dbg_filenames[$try_find_file]} ]] ; then echo "$try_find_file" @@ -164,7 +164,7 @@ basename=$_Dbg_cdir elif [[ $basename == '\$cwd' ]] ; then basename=$(pwd) fi - try_find_file=$(_Dbg_expand_filename "$basename/$find_file") + try_find_file="$(_Dbg_expand_filename "$basename/$find_file")" if [[ -n ${_Dbg_filenames[$try_find_file]} ]] ; then echo "$try_find_file" return 0