changeset 30:8cfc981a9b8e

Make the wrapper script happy if the current directory is in the cross compiler directory.
author Rob Landley <rob@landley.net>
date Sun, 10 Dec 2006 22:53:15 -0500
parents db08bdb5e9de
children 3e2c3a3095d8
files sources/toys/gcc-uClibc.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sources/toys/gcc-uClibc.c	Sun Dec 10 13:12:04 2006 -0500
+++ b/sources/toys/gcc-uClibc.c	Sun Dec 10 22:53:15 2006 -0500
@@ -120,6 +120,14 @@
 
 		temp = rindex(topdir,'/');
 		if(temp) *temp=0;
+		else {
+			// Are we in the same directory as the compiler?
+			if (!strcmp(".",topdir)) topdir="..";
+			// Are we right above it?
+			else topdir=".";
+			// If somebody makes a subdirectory under bin and calls gcc via
+			// "..", I really don't care.
+		}
 	}
 
 	// What's the name of the C compiler we're wrapping?  (It may have a