From d028e149adff03bbe26cc747fa845b14b54e95f8 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 18 Mar 2005 22:43:26 +0000 Subject: [PATCH] * gcc_update (apply_patch): Properly quote $1. From-SVN: r96705 --- contrib/ChangeLog | 4 ++++ contrib/gcc_update | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 7cd862a9b1e..16bd6e1fab4 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,7 @@ +2005-03-18 Andreas Schwab + + * gcc_update (apply_patch): Properly quote $1. + 2005-03-18 Zack Weinberg * gcc_update: Add --silent option. diff --git a/contrib/gcc_update b/contrib/gcc_update index 6b1c3f14185..dfe35dbdc16 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -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