summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@orbis-terrarum.net>2015-01-19 00:56:05 -0800
committerRobin H. Johnson <robbat2@orbis-terrarum.net>2015-01-19 00:56:05 -0800
commit3a5b26fbc472d74073f867e79e7e8f88e2f8c5b0 (patch)
treeb5f021954f86b4b9728e8132477f8445f1738bbc
parentMerge pull request #6 from floppym/fixes1 (diff)
parentfix https://bugs.gentoo.org/show_bug.cgi?id=536758 (diff)
downloadnetifrc-3a5b26fbc472d74073f867e79e7e8f88e2f8c5b0.tar.gz
netifrc-3a5b26fbc472d74073f867e79e7e8f88e2f8c5b0.tar.bz2
netifrc-3a5b26fbc472d74073f867e79e7e8f88e2f8c5b0.zip
Merge pull request #8 from casta/master
fix https://bugs.gentoo.org/show_bug.cgi?id=536758
-rw-r--r--sh/functions.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/sh/functions.sh b/sh/functions.sh
index 34aaa27..5895a90 100644
--- a/sh/functions.sh
+++ b/sh/functions.sh
@@ -34,11 +34,14 @@ if [ "$INIT" != "openrc" ]; then
}
shell_var() {
- local output=$1 sanitized_arg=
- shift 1
+ local output= sanitized_arg=
for arg; do
sanitized_arg="${arg//[^a-zA-Z0-9_]/_}"
- output="$output $arg"
+ if [ x"$output" = x"" ] ; then
+ output=$sanitized_arg
+ else
+ output="$output $sanitized_arg"
+ fi
done
echo "$output"
}