blob: fc86ddea118a474b2d1d33e1d145c4469899afcf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
match "ranlib" at the back of the string, such that <CHOST>-ranlib also
works correctly
--- cctools-698/misc/libtool.c
+++ cctools-698/misc/libtool.c
@@ -336,8 +336,9 @@
p++;
else
p = argv[0];
- if(strncmp(p, "ranlib", sizeof("ranlib") - 1) == 0)
- cmd_flags.ranlib = TRUE;
+ if ((i = strlen(p)) >= sizeof("ranlib") - 1 &&
+ strcmp(p + (i - (sizeof("ranlib") - 1)), "ranlib") == 0)
+ cmd_flags.ranlib = TRUE;
/* The default is to used long names */
cmd_flags.use_long_names = TRUE;
|