summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/dl-elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 2bcfcda64..8210a012e 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -182,7 +182,10 @@ search_for_named_library(const char *name, unsigned int rflags, const char *path
} else {
_dl_strcpy(mylibname, ".");
}
- _dl_strcat(mylibname, "/");
+ plen = _dl_strlen(mylibname);
+ if ((plen == 0) || (mylibname[plen-1] != '/')) {
+ _dl_strcat(mylibname, "/");
+ }
_dl_strcat(mylibname, name);
#ifdef __LDSO_SAFE_RUNPATH__
if (*mylibname == '/')