summaryrefslogtreecommitdiffstats
path: root/hooks
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-06-13 15:29:45 +0100
committerRoy Marples <roy@marples.name>2017-06-13 15:31:20 +0100
commit5e2a0d28cb37abcab2ecfc687161609ef9e05f78 (patch)
treeaf00005d4ae096ff747d0f0dadfdf7c7f8d40656 /hooks
parent510c760cb24ef4b1b16cc14732c5ffe0fbb0d96d (diff)
downloaddhcpcd-5e2a0d28cb37abcab2ecfc687161609ef9e05f78.tar.xz
In uniqify(), prefix a space if there is already a result when appending.
This means we don't have to trim a space on output.
Diffstat (limited to 'hooks')
-rw-r--r--hooks/dhcpcd-run-hooks.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/hooks/dhcpcd-run-hooks.in b/hooks/dhcpcd-run-hooks.in
index 78448cc6..db971342 100644
--- a/hooks/dhcpcd-run-hooks.in
+++ b/hooks/dhcpcd-run-hooks.in
@@ -33,10 +33,10 @@ uniqify()
for i do
case " $result " in
*" $i "*);;
- *) result="$result $i";;
+ *) result="$result${result:+ }$i";;
esac
done
- echo "${result# *}"
+ echo "$result"
}
# List interface config files in a directory.