From: Jan Dubois Date: Fri, 18 Aug 2000 16:31:48 +0000 (-0700) Subject: fix for Win32::GetFullPathName and Win32::GetShortPathName X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e8d3aa3b2e7edcd352aa3e0d8a884844f9aa9d5e;p=p5sagit%2Fp5-mst-13.2.git fix for Win32::GetFullPathName and Win32::GetShortPathName Message-ID: <2ihrps00u6qkpjtfq6f2b1d1ndkrs7l04u@4ax.com> p4raw-id: //depot/perl@6710 --- diff --git a/win32/win32.c b/win32/win32.c index 914ebfd..f0f629e 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -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),