Skip to content

Commit 36f158c

Browse files
akinomyogascop
andcommitted
fix(make): use "_comp_dequote" to expand the word
Co-authored-by: Ville Skyttä <[email protected]>
1 parent 2e22a6e commit 36f158c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

completions/make

+10-4
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ _make()
135135
# with -C/--directory
136136
for ((i = 1; i < ${#words[@]}; i++)); do
137137
if [[ ${words[i]} == -@(C|-directory) ]]; then
138-
# eval for tilde expansion
139-
eval "makef_dir=( -C \"${words[i + 1]}\" )"
138+
# Expand tilde expansion
139+
local ret
140+
_comp_dequote "${words[i + 1]}" &&
141+
[[ -d ${ret-} ]] &&
142+
makef_dir=(-C "$ret")
140143
break
141144
fi
142145
done
@@ -145,8 +148,11 @@ _make()
145148
# specified with -f/--file/--makefile
146149
for ((i = 1; i < ${#words[@]}; i++)); do
147150
if [[ ${words[i]} == -@(f|-?(make)file) ]]; then
148-
# eval for tilde expansion
149-
eval "makef=( -f \"${words[i + 1]}\" )"
151+
# Expand tilde expansion
152+
local ret
153+
_comp_dequote "${words[i + 1]}" &&
154+
[[ -f ${ret-} ]] &&
155+
makef=(-f "$ret")
150156
break
151157
fi
152158
done

0 commit comments

Comments
 (0)