This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix for Win32::GetFullPathName and Win32::GetShortPathName
authorJan Dubois <jand@activestate.com>
Fri, 18 Aug 2000 16:31:48 +0000 (09:31 -0700)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 19 Aug 2000 14:08:01 +0000 (14:08 +0000)
Message-ID: <2ihrps00u6qkpjtfq6f2b1d1ndkrs7l04u@4ax.com>

p4raw-id: //depot/perl@6710

win32/win32.c

index 914ebfd..f0f629e 100644 (file)
@@ -3927,6 +3927,9 @@ XS(w32_GetShortPathName)
 
     shortpath = sv_mortalcopy(ST(0));
     SvUPGRADE(shortpath, SVt_PV);
+    if (!SvPVX(shortpath) || !SvLEN(shortpath))
+        XSRETURN_UNDEF;
+
     /* src == target is allowed */
     do {
        len = GetShortPathName(SvPVX(shortpath),
@@ -3956,6 +3959,9 @@ XS(w32_GetFullPathName)
     filename = ST(0);
     fullpath = sv_mortalcopy(filename);
     SvUPGRADE(fullpath, SVt_PV);
+    if (!SvPVX(fullpath) || !SvLEN(fullpath))
+        XSRETURN_UNDEF;
+
     do {
        len = GetFullPathName(SvPVX(filename),
                              SvLEN(fullpath),