# HG changeset patch # User Rob Landley # Date 1167114011 18000 # Node ID 79295919b775e4c4e1364fcdd206f3c4dccbd3c2 # Parent 51b8220c37e723f34a3aca3fd8d3ef2deac08d06 Ok, when appending .. instead of truncating at /, remember the "stop truncating" part... diff -r 51b8220c37e7 -r 79295919b775 sources/toys/gcc-uClibc.c --- a/sources/toys/gcc-uClibc.c Tue Dec 26 00:02:40 2006 -0500 +++ b/sources/toys/gcc-uClibc.c Tue Dec 26 01:20:11 2006 -0500 @@ -125,19 +125,10 @@ putenv(temp); // The directory above the wrapper script should have include, gcc, - // and lib directories. - // Append ".." instead of simplifying path because the toolchain's bin - // could have a symlink pointing to it, ala /bin -> /usr/bin - temp = rindex(topdir,'/'); - if(temp) strcpy(++temp, ".."); - 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. - } + // and lib directories. However, the script could have a symlink + // pointing to its directory (ala /bin -> /usr/bin), so append ".." + // instead of trucating the path. + strcat(topdir,"/.."); } // What's the name of the C compiler we're wrapping? (It may have a @@ -519,7 +510,7 @@ dprintf(2, "\n\n"); } - //no need to free memory from xstrcat because we never return... + //no need to free memory from xstrcat because we never return. execvp(gcc_argv[0], gcc_argv); fprintf(stderr, "%s: %s\n", cpp ? cpp : cc, strerror(errno)); exit(EXIT_FAILURE);