From fda73e4137e774f0ccdb8bcd839f605745d6ab1b Mon Sep 17 00:00:00 2001
From: Alexandre Oliva <aoliva@cygnus.com>
Date: Thu, 18 May 2000 04:19:35 +0000
Subject: [PATCH] gcc_update (self): Set to `$0'.

* gcc_update (self): Set to `$0'.
(touch_files_reexec): Use `$self' instead of `$0'.
Reported by Albert Chin-A-Young <china@thewrittenword.com>

From-SVN: r33974
---
 contrib/ChangeLog  | 6 ++++++
 contrib/gcc_update | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 834966b3a08a..54ccaa8278f9 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,9 @@
+2000-05-18  Alexandre Oliva  <aoliva@cygnus.com>
+
+	* gcc_update (self): Set to `$0'.
+	(touch_files_reexec): Use `$self' instead of `$0'.
+	Reported by Albert Chin-A-Young <china@thewrittenword.com>
+
 2000-05-12  Alexandre Oliva  <aoliva@cygnus.com>
 
 	* gcc_update (touch_files_reexec): New function, run after the
diff --git a/contrib/gcc_update b/contrib/gcc_update
index a8d2ed7cc326..89677a4df1fa 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -43,6 +43,8 @@ UPDATE_OPTIONS=-P
 #        locally.
 # Add -A to reset any sticky tags, dates, or `-k' options.
 
+# Arrange for the value of $0 to be available for functions
+self=$0
 
 # This function prints a list of all generated files, along with their
 # dependencies.  Note that only one target is supported per line: the
@@ -117,7 +119,7 @@ touch_files () {
 # dependencies and rules will be used.
 touch_files_reexec () {
     echo "Adjusting file timestamps"
-    exec ${CONFIG_SHELL-/bin/sh} $0 --touch
+    exec ${CONFIG_SHELL-/bin/sh} $self --touch
 }    
 
 # This functions applies a patch to an existing tree.
-- 
GitLab