summaryrefslogtreecommitdiff
path: root/src/logic/linkcmd
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-27 02:11:56 +0000
committermidipix <writeonce@midipix.org>2024-02-27 02:11:56 +0000
commit3d4e32fa28edec2518a328c487dc4b308bd54b99 (patch)
tree6acd413ee9c7a7a02ec3b8d26ede8af94589a15f /src/logic/linkcmd
parent9bbe9f6d82a7dfb5e53e8d3c7f01ae456850d593 (diff)
downloadslibtool-3d4e32fa28edec2518a328c487dc4b308bd54b99.tar.bz2
slibtool-3d4e32fa28edec2518a328c487dc4b308bd54b99.tar.xz
slbt_exec_link_finalize_argument_vector(): -l redundancy: include .a in check.
Diffstat (limited to 'src/logic/linkcmd')
-rw-r--r--src/logic/linkcmd/slbt_linkcmd_argv.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/logic/linkcmd/slbt_linkcmd_argv.c b/src/logic/linkcmd/slbt_linkcmd_argv.c
index a44fdb8..3999b29 100644
--- a/src/logic/linkcmd/slbt_linkcmd_argv.c
+++ b/src/logic/linkcmd/slbt_linkcmd_argv.c
@@ -861,7 +861,7 @@ slbt_hidden int slbt_exec_link_finalize_argument_vector(
/* if all -l arguments following the previous */
/* occurence had already appeared before the */
/* previous argument, then the current */
- /* occurence is redundant. */
+ /* occurence is (possibly) redundant. */
for (darg=&larg[1]; rarg && darg<aarg; darg++) {
/* only test -l arguments */
@@ -872,6 +872,13 @@ slbt_hidden int slbt_exec_link_finalize_argument_vector(
}
}
+ /* any archive (.a) input arguments between the */
+ /* current occurrence and the previous one? */
+ for (darg=&larg[1]; rarg && darg<aarg; darg++)
+ if ((dot = strrchr(*darg,'.')))
+ if (!(strcmp(dot,arsuffix)))
+ rarg = 0;
+
/* final verdict: repeated -l argument? */
if (rarg) {
parg++;