summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2015-11-28 00:29:17 -0500
committerTony Cook <tony@develop-help.com>2015-12-02 09:17:09 +1100
commit7175d769b8a61b190222d193511702b1a312a325 (patch)
treeb9731ab9e86e0fa0c4711ff25fe8a62054dd9595 /win32
parenteb4e1baebc73747258f08c636d416082e02f2ad5 (diff)
downloadperl-7175d769b8a61b190222d193511702b1a312a325.tar.gz
move Win32's $^X code to where all other OSes' $^X code lives
Back when the code in perllib.c was first added in 1999, in commit 80252599d4 the large define tree function that today in 2015 is Perl_set_caret_X was an unremarkable single statement http://perl5.git.perl.org/perl.git/blob/80252599d4b7fb26eec4e3a0f451b4387c5dcc19:/perl.c#l2658 Over the years Perl_set_caret_X grew and grew with OS specific code. Move the Win32 $^X code to match how all the other OSes do it. Fix a problem where full perl's $^X is always absolute because perl5**.dll uses GetModuleFileNameW in perllib.c, but miniperl's $^X is always a relative path because it's coming from libc/command prompt/make tool/make_ext.pl. Win32 miniperl's $^X being relative causes inefficiencies in EUMM as a relative $^X is wrong the moment chdir executes in any perl process. EUMM contains code to search PATH and some other places to guess/figure out the absolute patch to the current perl to write the absolute perl path into the makefile. By making $^X absolute on all Win32 perl build variants, this find absolute perl path code won't execute in EUMM. It also harmonizes behavior with other OSes and between Win32 mini and full perl. See details in RT ticket for this patch.
Diffstat (limited to 'win32')
-rw-r--r--win32/perllib.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/win32/perllib.c b/win32/perllib.c
index 0e44a247be..cf7bf563d2 100644
--- a/win32/perllib.c
+++ b/win32/perllib.c
@@ -211,14 +211,8 @@ RunPerl(int argc, char **argv, char **env)
{
int exitstatus;
PerlInterpreter *my_perl, *new_perl = NULL;
- char *arg0 = argv[0];
- char *ansi = NULL;
bool use_environ = (env == environ);
- WCHAR widename[MAX_PATH];
- GetModuleFileNameW(NULL, widename, sizeof(widename)/sizeof(WCHAR));
- argv[0] = ansi = win32_ansipath(widename);
-
#ifdef PERL_GLOBAL_STRUCT
#define PERLVAR(prefix,var,type) /**/
#define PERLVARA(prefix,var,type) /**/
@@ -269,11 +263,6 @@ RunPerl(int argc, char **argv, char **env)
}
#endif
- /* Some RTLs may want to free argv[] after main() returns. */
- argv[0] = arg0;
- if (ansi)
- win32_free(ansi);
-
PERL_SYS_TERM();
return (exitstatus);