Skip to content

Commit

Permalink
ipfs-test-lib: add IFS=' ' in shellquote()
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
  • Loading branch information
chriscool committed Oct 3, 2015
1 parent f823837 commit 08be596
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/ipfs-test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ test_sort_cmp() {

# Quote arguments for sh eval
shellquote() {
_space=''
for _arg
do
printf '%s' "$_space"
printf '%s' "$_arg" | sed -e "s/'/'\\\\''/g; s/^/'/; s/\$/'/;"
_space=' '
done
printf '\n'
(
IFS=' '
_space=''
for _arg
do
printf '%s' "$_space"
printf '%s' "$_arg" | sed -e "s/'/'\\\\''/g; s/^/'/; s/\$/'/;"
_space=' '
done
printf '\n'
)
}

0 comments on commit 08be596

Please sign in to comment.