]> source.dussan.org Git - sonarqube.git/commitdiff
[script] avoid side effects in call_patches function
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 4 Jan 2017 16:29:55 +0000 (17:29 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 10 Jan 2017 11:01:57 +0000 (12:01 +0100)
scripts/patches_utils.sh

index 2b79cd18406f684a3c1ea0efefe2bcf4c70c8906..1792a4ce5a64c5133334218c5e2a88656076b66b 100755 (executable)
@@ -10,9 +10,10 @@ PATCHES_HOME=scripts/patches
 # $1: name(s) of patches to call, separated by a colon
 # all other arguments are passed as is to the patches
 function call_patches() {
-  PATCHES=$1
-  ARGS=${@:2}
-
+  local PATCHES=$1
+  local ARGS=${@:2}
+  local savedIFS=$IFS
+  
   IFS=','
   for PATCH in $PATCHES; do
     #echo "calling $PATCHES_HOME/$PATCH.sh $ARGS"
@@ -20,6 +21,7 @@ function call_patches() {
     echo "******** $PATCH *******"
     $PATCHES_HOME/$PATCH.sh $ARGS
   done
+  IFS=$savedIFS
 
   echo ""
 }