This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate change #12146 from maintperl;
[perl5.git] / win32 / perlhost.h
index a417f66..1714601 100644 (file)
@@ -2368,6 +2368,10 @@ CPerlHost::Chdir(const char *dirname)
 {
     dTHX;
     int ret;
+    if (!dirname) {
+       errno = ENOENT;
+       return -1;
+    }
     if (USING_WIDE()) {
        WCHAR wBuffer[MAX_PATH];
        A2WHELPER(dirname, wBuffer, sizeof(wBuffer));