]> sourceware.org Git - newlib-cygwin.git/commitdiff
dlopen: Add dot to filename if no slash is present
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 1 Jun 2016 11:12:08 +0000 (13:12 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 1 Jun 2016 11:12:22 +0000 (13:12 +0200)
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>
winsup/cygwin/dlfcn.cc

index 914411cdb7b9755290dd32739346fa0bf770f80c..ad4d96c7ec1c179b667651185bfab891ac1b29af 100644 (file)
@@ -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".");
 
This page took 0.02702 seconds and 5 git commands to generate.