From: Steve Hay Date: Tue, 26 Jun 2007 09:10:24 +0000 (+0000) Subject: Upgrade to Win32-0.30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b3eb56ab08de3eb8c62add0c65ac4e1dfc662e1b;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Win32-0.30 p4raw-id: //depot/perl@31470 --- diff --git a/MANIFEST b/MANIFEST index e3f05ea..a5e940e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1223,6 +1223,7 @@ ext/Win32/t/GetFolderPath.t See if Win32 extension works ext/Win32/t/GetFullPathName.t See if Win32 extension works ext/Win32/t/GetLongPathName.t See if Win32 extension works ext/Win32/t/GetOSVersion.t See if Win32 extension works +ext/Win32/t/GetShortPathName.t See if Win32 extension works ext/Win32/t/GuidGen.t See if Win32 extension works ext/Win32/t/Unicode.t See if Win32 extension works ext/Win32/Win32.pm Win32 extension Perl module diff --git a/ext/Win32/Makefile.PL b/ext/Win32/Makefile.PL index 742c50d..114a0a2 100644 --- a/ext/Win32/Makefile.PL +++ b/ext/Win32/Makefile.PL @@ -9,6 +9,7 @@ WriteMakefile( VERSION_FROM => 'Win32.pm', LIBS => \@libs, INSTALLDIRS => ($] >= 5.008004 ? 'perl' : 'site'), + NO_META => 1, AUTHOR => 'Jan Dubois ', ABSTRACT_FROM => 'Win32.pm', diff --git a/ext/Win32/Win32.pm b/ext/Win32/Win32.pm index 116d3f5..78faf03 100644 --- a/ext/Win32/Win32.pm +++ b/ext/Win32/Win32.pm @@ -8,7 +8,7 @@ BEGIN { require DynaLoader; @ISA = qw|Exporter DynaLoader|; - $VERSION = '0.29'; + $VERSION = '0.30'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -605,7 +605,8 @@ different major/minor version number than Windows XP. (8.3) path components where available. For path components where the file system has not generated the short form the returned path will use the long form, so this function might still for instance return a -path containing spaces. Compare with Win32::GetFullPathName() and +path containing spaces. Returns C when the PATHNAME does not +exist. Compare with Win32::GetFullPathName() and Win32::GetLongPathName(). =item Win32::GetProcAddress(INSTANCE, PROCNAME) @@ -650,8 +651,8 @@ Returns non zero if the account in whose security context the current process/thread is running belongs to the local group of Administrators in the built-in system domain; returns 0 if not. On Windows Vista it will only return non-zero if the process is -actually running with elevated privileges. Returns the undefined -value and prints a warning if an error occurred. This function always +actually running with elevated privileges. Returns C +and prints a warning if an error occurred. This function always returns 1 on Win9X. =item Win32::IsWinNT() diff --git a/ext/Win32/Win32.xs b/ext/Win32/Win32.xs index cf3c8fe..dea01c1 100644 --- a/ext/Win32/Win32.xs +++ b/ext/Win32/Win32.xs @@ -1337,7 +1337,7 @@ XS(w32_GetShortPathName) WCHAR *wlong = sv_to_wstr(aTHX_ ST(0)); len = GetShortPathNameW(wlong, wshort, countof(wshort)); Safefree(wlong); - if (len < sizeof(wshort)) { + if (len && len < sizeof(wshort)) { ST(0) = wstr_to_sv(aTHX_ wshort); XSRETURN(1); } diff --git a/ext/Win32/t/GetShortPathName.t b/ext/Win32/t/GetShortPathName.t new file mode 100644 index 0000000..4553854 --- /dev/null +++ b/ext/Win32/t/GetShortPathName.t @@ -0,0 +1,20 @@ +use strict; +use Test; +use Win32; + +my $path = "Long Path $$"; +unlink($path); +END { unlink $path } + +plan tests => 5; + +Win32::CreateFile($path); +ok(-f $path); + +my $short = Win32::GetShortPathName($path); +ok($short, qr/^\S{1,8}(\.\S{1,3})?$/); +ok(-f $short); + +unlink($path); +ok(!-f $path); +ok(!defined Win32::GetShortPathName($path)); diff --git a/ext/Win32/t/Unicode.t b/ext/Win32/t/Unicode.t index f8f03b8..b01057b 100644 --- a/ext/Win32/t/Unicode.t +++ b/ext/Win32/t/Unicode.t @@ -1,6 +1,5 @@ use strict; use Test; - use Cwd qw(cwd); use Win32;