diff options
author | Robin H. Johnson <robbat2@orbis-terrarum.net> | 2015-01-19 00:56:05 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@orbis-terrarum.net> | 2015-01-19 00:56:05 -0800 |
commit | 3a5b26fbc472d74073f867e79e7e8f88e2f8c5b0 (patch) | |
tree | b5f021954f86b4b9728e8132477f8445f1738bbc | |
parent | Merge pull request #6 from floppym/fixes1 (diff) | |
parent | fix https://bugs.gentoo.org/show_bug.cgi?id=536758 (diff) | |
download | netifrc-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.sh | 9 |
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" } |