From: Roy Marples Date: Tue, 13 Jun 2017 14:29:45 +0000 (+0100) Subject: In uniqify(), prefix a space if there is already a result when appending. X-Git-Tag: v7.0.0-rc2~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=388b27468240449b5bdd10ddd6971213c31e3364;p=thirdparty%2Fdhcpcd.git 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. --- 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.