[llvm-commits] [llvm-gcc-4.2] r44475 - /llvm-gcc-4.2/trunk/driverdriver.c
Bill Wendling
isanbard at gmail.com
Fri Nov 30 15:13:54 PST 2007
Author: void
Date: Fri Nov 30 17:13:52 2007
New Revision: 44475
URL: http://llvm.org/viewvc/llvm-project?rev=44475&view=rev
Log:
Change the prefix_len if it's not curr_dir.
Modified:
llvm-gcc-4.2/trunk/driverdriver.c
Modified: llvm-gcc-4.2/trunk/driverdriver.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/driverdriver.c?rev=44475&r1=44474&r2=44475&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/driverdriver.c (original)
+++ llvm-gcc-4.2/trunk/driverdriver.c Fri Nov 30 17:13:52 2007
@@ -1196,6 +1196,7 @@
char *override_option_str = NULL;
char path_buffer[2*PATH_MAX+1];
int linklen;
+ int delete_prefix = 0;
total_argc = argc;
prog_len = 0;
@@ -1258,10 +1259,12 @@
size_t bin_dir_len = strlen (llvm_bin_dir);
if (curr_dir_len <= bin_dir_len ||
- strncmp (&curr_dir[curr_dir_len - bin_dir_len], llvm_bin_dir, bin_dir_len) != 0)
+ strncmp (&curr_dir[curr_dir_len - bin_dir_len], llvm_bin_dir, bin_dir_len) != 0) {
driver_exec_prefix =
make_relative_prefix (argv[0], curr_dir, "/usr/llvm-gcc-4.2/bin/");
- else
+ delete_prefix = 1;
+ prefix_len = strlen (driver_exec_prefix);
+ } else
driver_exec_prefix = curr_dir;
}
/* LLVM LOCAL end - These drivers live in /.../usr/llvm-gcc-4.2/bin */
@@ -1550,5 +1553,7 @@
final_cleanup ();
free (curr_dir);
+ if (delete_prefix)
+ free (driver_exec_prefix);
return greatest_status;
}
More information about the llvm-commits
mailing list