summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-02 14:00:05 -0400
committermidipix <writeonce@midipix.org>2016-04-02 14:22:55 -0400
commit53aa85177cf44dbe997a9dfeb6072f913aca3b5b (patch)
tree06480f7dc803889c67e6d3e4cba70a7429727b82 /src
parent6875671fe76ec65c684b1ae8b308e9344db8cc4e (diff)
downloadslibtool-53aa85177cf44dbe997a9dfeb6072f913aca3b5b.tar.bz2
slibtool-53aa85177cf44dbe997a9dfeb6072f913aca3b5b.tar.xz
link mode: slbt_adjust_input_argument(): properly handle pic objects.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_link.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 4462d2f..7816749 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -26,7 +26,9 @@
static bool slbt_adjust_input_argument(char * arg, bool fpic)
{
+ char * slash;
char * dot;
+ char base[PATH_MAX];
if (*arg == '-')
return false;
@@ -38,13 +40,22 @@ static bool slbt_adjust_input_argument(char * arg, bool fpic)
return false;
if (fpic) {
- /* to do */
- return false;
- } else {
- dot[1] = 'o';
- dot[2] = '\0';
- return true;
+ if ((slash = strrchr(arg,'/')))
+ slash++;
+ else
+ slash = arg;
+
+ if ((size_t)snprintf(base,sizeof(base),"%s",
+ slash) >= sizeof(base))
+ return false;
+
+ sprintf(slash,".libs/%s",base);
+ dot = strrchr(arg,'.');
}
+
+ dot[1] = 'o';
+ dot[2] = '\0';
+ return true;
}
static int slbt_exec_link_create_archive(