diff options
-rw-r--r-- | ext/POSIX/POSIX.xs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 6c5c70b77c..145dab7342 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -4048,15 +4048,10 @@ getcwd() else PUSHs(&PL_sv_undef); #else - dSP; require_pv("Cwd.pm"); - - ENTER; - SAVETMPS; + /* Module require may have grown the stack */ + SPAGAIN; PUSHMARK(sp); PUTBACK; - call_pv("Cwd::cwd", GIMME_V); - FREETMPS; - LEAVE; - XSRETURN(1); + XSRETURN(call_pv("Cwd::cwd", GIMME_V)); #endif |