diff --git a/require.c b/require.c index 1a5c49d..a4e6358 100644 --- a/require.c +++ b/require.c @@ -780,7 +780,7 @@ static void registerExternalModules() if (!GetModuleFileName(hMods[i], name, MAX_PATH)) continue; /* no library name */ name[sizeof(name)-1] = 0; /* WinXP may not terminate the string */ p = strrchr(name, '\\'); /* find file name part in "/.dll" */ - if (p) { location = name; } else p=name; /* find end of "\\" (if exists) */ + if (p) { location = name; p++; } else p=name; /* find end of "\\" (if exists) */ symname = p; p = strchr(symname, '.'); /* find ".dll" */ if (p == NULL) p = symname + strlen(symname); /* no file extension ? */