OSDN Git Service

envsetup: fix mm under zsh
authorKhalid Zubair <kzubair@cyngn.com>
Wed, 2 Mar 2016 22:01:45 +0000 (14:01 -0800)
committerMichael Bestas <mikeioannina@gmail.com>
Fri, 6 Jan 2017 23:37:37 +0000 (01:37 +0200)
Fix a word splitting issue in zsh. Instead of building a duplicate
ARGS array for the !GET-INSTALL-PATH case, leave it untouched. For the
GET-INSTALL-PATH case, modify the argument list as needed.

Change-Id: I902ff1bc7a53e7afa8c4737d4208592ac18f95d7

envsetup.sh

index 0c395c7..7dd7937 100644 (file)
@@ -806,7 +806,6 @@ function mm()
         local M=$(findmakefile)
         local MODULES=
         local GET_INSTALL_PATH=
-        local ARGS=
         # Remove the path to top as the makefilepath needs to be relative
         local M=`echo $M|sed 's:'$T'/::'`
         if [ ! "$T" ]; then
@@ -823,12 +822,12 @@ function mm()
             done
             if [ -n "$GET_INSTALL_PATH" ]; then
               MODULES=
-              ARGS=GET-INSTALL-PATH
+              # set all args to 'GET-INSTALL-PATH'
+              set -- GET-INSTALL-PATH
             else
               MODULES=all_modules
-              ARGS=$@
             fi
-            ONE_SHOT_MAKEFILE=$M $DRV make -C $T -f build/core/main.mk $MODULES $ARGS
+            ONE_SHOT_MAKEFILE=$M $DRV make -C $T -f build/core/main.mk $MODULES "$@"
         fi
     fi
 }