summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/win32.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 67e8952de7..65d5f661d9 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3564,6 +3564,25 @@ win32_dynaload(const char* filename)
{
dTHXo;
HMODULE hModule;
+ char buf[MAX_PATH+1];
+ char *first;
+
+ /* LoadLibrary() doesn't recognize forward slashes correctly,
+ * so turn 'em back. */
+ first = strchr(filename, '/');
+ if (first) {
+ STRLEN len = strlen(filename);
+ if (len <= MAX_PATH) {
+ strcpy(buf, filename);
+ filename = &buf[first - filename];
+ while (*filename) {
+ if (*filename == '/')
+ *(char*)filename = '\\';
+ ++filename;
+ }
+ filename = buf;
+ }
+ }
if (USING_WIDE()) {
WCHAR wfilename[MAX_PATH+1];
A2WHELPER(filename, wfilename, sizeof(wfilename));