From c3e462bf2b8f14bdaabc96f419558a7f0dfdf1ef Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 20 Sep 2016 20:09:42 +1200 Subject: Add some var quoting within param expansion --- bash/bashrc.d/prompt.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bash/bashrc.d') diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index b3a26c89..856e20e6 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -114,15 +114,15 @@ prompt() { # Check various files in .git to flag processes local proc [[ -d .git/rebase-merge || -d .git/rebase-apply ]] && - proc=${proc:+$proc,}'REBASE' + proc=${proc:+"$proc",}'REBASE' [[ -f .git/MERGE_HEAD ]] && - proc=${proc:+$proc,}'MERGE' + proc=${proc:+"$proc",}'MERGE' [[ -f .git/CHERRY_PICK_HEAD ]] && - proc=${proc:+$proc,}'PICK' + proc=${proc:+"$proc",}'PICK' [[ -f .git/REVERT_HEAD ]] && - proc=${proc:+$proc,}'REVERT' + proc=${proc:+"$proc",}'REVERT' [[ -f .git/BISECT_LOG ]] && - proc=${proc:+$proc,}'BISECT' + proc=${proc:+"$proc",}'BISECT' # Collect symbols representing repository state local state @@ -157,7 +157,7 @@ prompt() { # Print the status in brackets; add a git: prefix only if there # might be another VCS prompt (because PROMPT_VCS is set) printf '(%s%s%s%s)' \ - "${PROMPT_VCS:+git:}" "$name" "${proc:+:$proc}" "$state" + "${PROMPT_VCS:+git:}" "$name" "${proc:+:"$proc"}" "$state" ;; # Subversion prompt function -- cgit v1.2.3