1 |
Author: grobian |
2 |
Date: 2009-03-21 12:58:57 +0000 (Sat, 21 Mar 2009) |
3 |
New Revision: 1639 |
4 |
|
5 |
Modified: |
6 |
trunk/toolchain-prefix-wrapper/ld/gnuplugin.c |
7 |
Log: |
8 |
Fix path check in case of -R, don't try to resolve a combined :-separated path |
9 |
|
10 |
Modified: trunk/toolchain-prefix-wrapper/ld/gnuplugin.c |
11 |
=================================================================== |
12 |
--- trunk/toolchain-prefix-wrapper/ld/gnuplugin.c 2009-03-19 19:01:19 UTC (rev 1638) |
13 |
+++ trunk/toolchain-prefix-wrapper/ld/gnuplugin.c 2009-03-21 12:58:57 UTC (rev 1639) |
14 |
@@ -82,27 +82,43 @@ |
15 |
} |
16 |
|
17 |
err = 0; |
18 |
- for(curr = next = argBuffer; !err && *next != '\0'; curr = next+1) { |
19 |
+ for (curr = next = argBuffer; !err && *next != '\0'; curr = next+1) { |
20 |
err = -1; |
21 |
|
22 |
- for(next = curr; *next != '\0' && *next != ':'; next++); |
23 |
+ for (next = curr; *next != '\0' && *next != ':'; next++); |
24 |
|
25 |
if (curr == argBuffer && rpathArg == _R) { |
26 |
struct stat sbuf; |
27 |
- int rv = stat(curr, &sbuf); |
28 |
- /* if argument to "-R" is not a directory, then it is not a rpath */ |
29 |
+ int rv; |
30 |
+ char colon = *next == ':'; |
31 |
+ /* terminate the string in case of ':' */ |
32 |
+ if (colon) |
33 |
+ *next = '\0'; |
34 |
+ rv = stat(curr, &sbuf); |
35 |
+ /* if argument to "-R" is not a directory, then |
36 |
+ * it is not a rpath */ |
37 |
if (rv != 0 || (sbuf.st_mode & S_IFDIR) == 0) { |
38 |
if (StringListAppendConcat(data->out->argList |
39 |
, _R, _R_len |
40 |
, curr, next - curr |
41 |
- , NULL) < 0) { |
42 |
+ , NULL) < 0) |
43 |
+ { |
44 |
+ /* uncut string again */ |
45 |
+ if (colon) |
46 |
+ *next = ':'; |
47 |
/* failed to append arg */ |
48 |
break; |
49 |
} |
50 |
+ /* uncut string again */ |
51 |
+ if (colon) |
52 |
+ *next = ':'; |
53 |
/* done */ |
54 |
err = 0; |
55 |
break; |
56 |
} |
57 |
+ /* uncut string again */ |
58 |
+ if (colon) |
59 |
+ *next = ':'; |
60 |
} |
61 |
|
62 |
if (next - curr <= 1) { |