Skip to content

Commit

Permalink
Quote variables when doing substring manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
andsens committed Jul 26, 2024
1 parent 226c433 commit 3b77a58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/commands/track.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ track() {
for homepath in $files_to_track; do
IFS=$oldIFS

local relpath=${homepath#$HOME/}
local relpath=${homepath#"$HOME/"}
pending 'track' "$relpath"
local relpath_in_repo="home/$relpath"
local repopath="$repo/$relpath_in_repo"
Expand Down
4 changes: 2 additions & 2 deletions lib/fs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ create_rel_path() {
if [[ $target = "${prefix%/}" ]]; then
target_path=''
else
target_path=${target##$prefix}
target_path=${target##"$prefix"}
fi
# The path from the common directory to the source_dir is
# $source_dir without the prefix
local source_dir_path
source_dir_path=${source_dir##$prefix}
source_dir_path=${source_dir##"$prefix"}

# Determine the path from the source_dir to the common directory (consists only of ../)
local common_dir_path=''
Expand Down

0 comments on commit 3b77a58

Please sign in to comment.