From: Michael Tremer Date: Fri, 10 Aug 2012 09:32:29 +0000 (+0000) Subject: list: Avoid space in front of the first argument. X-Git-Tag: 005~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7aa696d1a8253b31a1973b01f34911818d1f7110;p=network.git list: Avoid space in front of the first argument. When the first argument was added to an empty list, there was a leading space character which looks ugly. --- diff --git a/functions.list b/functions.list index d6d5305e..bf5ab0e3 100644 --- a/functions.list +++ b/functions.list @@ -28,7 +28,11 @@ function list_append() { assert isset list - eval "${list}=\"${!list} $@\"" + if [ -n "${!list}" ]; then + printf -v ${list} "${!list} $@" + else + printf -v ${list} "$@" + fi } function list_remove() {