From a498d3edfafd023125a4618e63ea641d8d532a40 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 Jun 2016 12:05:23 +1200 Subject: Switch back to read array split for targets Works better than the well-intended while-read loop --- bash/bashrc.d/make.bash | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bash') 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 -- cgit v1.2.3