diff options
Diffstat (limited to 'win32/runperl.c')
-rw-r--r-- | win32/runperl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/win32/runperl.c b/win32/runperl.c index 8cf521d4ea..20423c7660 100644 --- a/win32/runperl.c +++ b/win32/runperl.c @@ -41,8 +41,11 @@ main(int argc, char **argv, char **env) * want to free() argv after main() returns. As luck would have it, * Borland's CRT does the right thing to argv[0] already. */ char szModuleName[MAX_PATH]; + char *ptr; GetModuleFileName(NULL, szModuleName, sizeof(szModuleName)); + (void)GetFullPathName(szModuleName, sizeof(szModuleName), + szModuleName, &ptr); argv[0] = szModuleName; #endif @@ -87,7 +90,11 @@ main(int argc, char **argv, char **env) * want to free() argv after main() returns. As luck would have it, * Borland's CRT does the right thing to argv[0] already. */ char szModuleName[MAX_PATH]; + char *ptr; + GetModuleFileName(NULL, szModuleName, sizeof(szModuleName)); + (void)GetFullPathName(szModuleName, sizeof(szModuleName), + szModuleName, &ptr); argv[0] = szModuleName; #endif return RunPerl(argc, argv, env, (void*)0); |