OSDN Git Service

* gcc_update (apply_patch): Properly quote $1.
authorschwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Mar 2005 22:43:26 +0000 (22:43 +0000)
committerschwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Mar 2005 22:43:26 +0000 (22:43 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96705 138bc75d-0d04-0410-961f-82ee72b054a4

contrib/ChangeLog
contrib/gcc_update

index 7cd862a..16bd6e1 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-18  Andreas Schwab  <schwab@suse.de>
+
+       * gcc_update (apply_patch): Properly quote $1.
+
 2005-03-18  Zack Weinberg  <zack@codesourcery.com>
 
        * gcc_update: Add --silent option.
index 6b1c3f1..dfe35db 100755 (executable)
@@ -166,15 +166,15 @@ touch_files_reexec () {
 
 # This functions applies a patch to an existing tree.
 apply_patch () {
-    if [ -f $1 ]; then
+    if [ -f "$1" ]; then
        echo "Applying patch file $1"
-       case "$1" in
+       case $1 in
        *gz)
-           gzip -d -c $1 | patch -p1 ;;
+           gzip -d -c "$1" | patch -p1 ;;
        *bz2)
-           bzip2 -d -c $1 | patch -p1 ;;
+           bzip2 -d -c "$1" | patch -p1 ;;
        *)
-           cat $1 | patch -p1 ;;
+           patch -p1 < "$1";;
        esac
     fi
     touch_files_reexec