aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/make.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d/make.bash')
-rw-r--r--bash/bashrc.d/make.bash10
1 files changed, 8 insertions, 2 deletions
diff --git a/bash/bashrc.d/make.bash b/bash/bashrc.d/make.bash
index 094e9657..ca209e8e 100644
--- a/bash/bashrc.d/make.bash
+++ b/bash/bashrc.d/make.bash
@@ -14,7 +14,13 @@ _make() {
*:*)
# Break the target up with space delimiters
- while IFS= read -d ' ' -r target ; do
+ local -a targets
+ IFS=' ' read -a targets -d '' < \
+ <(printf '%s\0' "${line%%:*}")
+
+ # Iterate through the targets and add suitable ones
+ local target
+ for target in "${targets[@]}" ; do
case $target in
# Don't complete special targets beginning with a
@@ -30,7 +36,7 @@ _make() {
COMPREPLY[${#COMPREPLY[@]}]=$target
;;
esac
- done < <(printf '%s' "${line%%:*}")
+ done
;;
esac
done < Makefile