Skip to content

Commit

Permalink
Quote a few more file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jansorg committed Dec 30, 2024
1 parent 6c9d979 commit b78910a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/filecache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit b78910a

Please sign in to comment.