summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 914411cdb..ad4d96c7e 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".");