]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Improve LzmaF86Compress wrapper
authorCharles Duffy <chaduffy@cisco.com>
Wed, 20 Jan 2016 05:15:55 +0000 (05:15 +0000)
committeryzhu52 <yzhu52@Edk2>
Wed, 20 Jan 2016 05:15:55 +0000 (05:15 +0000)
- Remove test usage declared obsolescent by POSIX
- Pass argv array through as literal rather than forming into a string, then
  string-splitting and glob-expanding same.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Charles Duffy <chaduffy@cisco.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19697 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaF86Compress
BaseTools/BinWrappers/PosixLike/LzmaF86Compress

index c3e49cf29d8f75704aea54dd14a41cd948d75ef4..50af530cbdb405c61df8b8e83a9cff7aabd74cbb 100755 (executable)
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 
-for arg in $*; do
-  if [ "arg" = "-e" -o "arg" = "-d" ]; then
-    FLAG=--f86
-    break;
-  fi
-done
+for arg; do
+  case $arg in
+    -e|-d)
+      set -- "$@" --f86
+      break
+    ;;
+esac
 
-LzmaCompress $* $FLAG
+exec LzmaCompress "$@"
index 18946a4d2dc4e655bcfe2e3e04042be22a2d078b..50af530cbdb405c61df8b8e83a9cff7aabd74cbb 100755 (executable)
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 
-for arg in $*; do
-  if [ "$arg" = "-e" -o "$arg" = "-d" ]; then
-    FLAG=--f86
-    break;
-  fi
-done
+for arg; do
+  case $arg in
+    -e|-d)
+      set -- "$@" --f86
+      break
+    ;;
+esac
 
-LzmaCompress $* $FLAG
+exec LzmaCompress "$@"