summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-06-01 11:12:08 (GMT)
committerCorinna Vinschen <corinna@vinschen.de>2016-06-01 11:12:22 (GMT)
commit8a31aa37bc97215f137fc705b5f6e43e06683c15 (patch)
treeee49f4725a2e974b415a689fb449207d2acbcb62
parentc496a068cf653c7e94eac014542914f087ef4585 (diff)
downloadcygnal-8a31aa37bc97215f137fc705b5f6e43e06683c15.zip
cygnal-8a31aa37bc97215f137fc705b5f6e43e06683c15.tar.gz
cygnal-8a31aa37bc97215f137fc705b5f6e43e06683c15.tar.bz2
dlopen: Add dot to filename if no slash is present
We're appending a dot to the filename before calling LoadLibrary to override ".dll" automagic. This only worked for paths, not for simple filenames since it required a slash in the pathname. Fix that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/dlfcn.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc
index 914411c..ad4d96c 100644
--- a/winsup/cygwin/dlfcn.cc
+++ b/winsup/cygwin/dlfcn.cc
@@ -135,7 +135,7 @@ dlopen (const char *name, int flags)
/* Check if the last path component contains a dot. If so,
leave the filename alone. Otherwise add a trailing dot
to override LoadLibrary's automatic adding of a ".dll" suffix. */
- wchar_t *last_bs = wcsrchr (path, L'\\');
+ wchar_t *last_bs = wcsrchr (path, L'\\') ?: path;
if (last_bs && !wcschr (last_bs, L'.'))
wcscat (last_bs, L".");