From 7aa696d1a8253b31a1973b01f34911818d1f7110 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 10 Aug 2012 09:32:29 +0000 Subject: [PATCH] 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. --- functions.list | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() { -- 2.47.3