This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Quoting bug in gcc_update


This fixes some missing quotes in gcc_update.  Committed as obvious.

Andreas.

2005-03-18  Andreas Schwab  <schwab@suse.de>

	* gcc_update (apply_patch): Properly quote $1.

--- contrib/gcc_update.~1.80.~	2005-03-18 23:19:36.000000000 +0100
+++ contrib/gcc_update	2005-03-18 23:26:37.000000000 +0100
@@ -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

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]