@@ -3704,8 +3704,8 @@ inline op nqp_getlexrelcaller(out PMC, in PMC, in STR) :base_core {
3704
3704
}
3705
3705
3706
3706
inline op nqp_delete_f(out INT, in STR) :base_core {
3707
- #ifdef WIN32
3708
3707
char* const filename = Parrot_str_to_platform_cstring(interp, $2);
3708
+ #ifdef WIN32
3709
3709
DWORD attrs = GetFileAttributesA(filename);
3710
3710
INTVAL ret;
3711
3711
@@ -3724,7 +3724,6 @@ inline op nqp_delete_f(out INT, in STR) :base_core {
3724
3724
3725
3725
$1 = ret;
3726
3726
#else
3727
- char* const filename = Parrot_str_to_platform_cstring(interp, $2);
3728
3727
$1 = unlink(filename);
3729
3728
#endif
3730
3729
}
@@ -3740,32 +3739,23 @@ inline op nqp_spawn(out INT, in PMC, in STR, in PMC) {
3740
3739
}
3741
3740
3742
3741
inline op nqp_shell(out INT, in STR, in STR, in PMC) {
3743
- #ifdef WIN32
3744
3742
STRING *dir = $3;
3745
3743
PMC *env = $4;
3746
3744
STRING * const old_cwd = Parrot_file_getcwd(interp);
3747
3745
PMC * command = Parrot_pmc_new(interp, enum_class_ResizableStringArray);
3746
+ #ifdef WIN32
3748
3747
const STRING *comspec = Parrot_str_new(interp, "ComSpec", 0);
3749
3748
VTABLE_push_string(interp, command, Parrot_getenv(interp, comspec));
3750
3749
VTABLE_push_string(interp, command, Parrot_str_new_constant(interp, "/c"));
3751
- VTABLE_push_string(interp, command, $2);
3752
-
3753
- Parrot_file_chdir(interp, dir);
3754
- $1 = Run_OS_Command(interp, command, env);
3755
- Parrot_file_chdir(interp, old_cwd);
3756
3750
#else
3757
- STRING *dir = $3;
3758
- PMC *env = $4;
3759
- STRING * const old_cwd = Parrot_file_getcwd(interp);
3760
- PMC * command = Parrot_pmc_new(interp, enum_class_ResizableStringArray);
3761
3751
VTABLE_push_string(interp, command, Parrot_str_new_constant(interp, "sh"));
3762
3752
VTABLE_push_string(interp, command, Parrot_str_new_constant(interp, "-c"));
3753
+ #endif
3763
3754
VTABLE_push_string(interp, command, $2);
3764
3755
3765
3756
Parrot_file_chdir(interp, dir);
3766
3757
$1 = Run_OS_Command(interp, command, env);
3767
3758
Parrot_file_chdir(interp, old_cwd);
3768
- #endif
3769
3759
}
3770
3760
3771
3761
inline op nqp_getenvhash(out PMC) {
0 commit comments