From c3d64d60d4cb3875e591cfc5766185474067ea27 Mon Sep 17 00:00:00 2001 From: sghctoma Date: Sat, 31 Oct 2015 20:50:49 +0100 Subject: [PATCH] Fixed quoting in wrapper shell scripts. --- Makefile | 2 +- env.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 24ad3fffca4b4..020e704d59635 100644 --- a/Makefile +++ b/Makefile @@ -220,7 +220,7 @@ purge-doc: rm -f "${DESTDIR}${MANDIR}/man1/r2.1" user-wrap=echo "\#!/bin/sh" > ~/bin/"$1" \ -; echo "${PWD}/env.sh '${PREFIX}' '$1' \$$@" >> ~/bin/"$1" \ +; echo "${PWD}/env.sh '${PREFIX}' '$1' \"\$$@\"" >> ~/bin/"$1" \ ; chmod +x ~/bin/"$1" ; user-install: diff --git a/env.sh b/env.sh index dc77e78df809e..c6b5136fb2ebc 100755 --- a/env.sh +++ b/env.sh @@ -47,5 +47,11 @@ if [ -z "$*" ]; then echo "==> Back to system shell..." echo else - eval $new_env $* + if [ $# -gt 1 ]; then + par="" + for p in `seq 1 $(($#-1))`; do par=$par"\$$p "; done + eval $new_env $par "\"\$$#\"" + else + eval $new_env $* + fi fi