mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 13:09:22 +02:00
* fixed do_getdir() for non-defaultdrive after r25042 ("drive" array has to
be an array of widechar now) * fixed restoring of original path in do_getdir() (pass contents of unicodestring to SetCurrentDirectoryW(), not its address) git-svn-id: branches/cpstrrtl@25088 -
This commit is contained in:
parent
26b2149ced
commit
ba49e4a29d
@ -74,7 +74,7 @@ end;
|
|||||||
procedure do_GetDir (DriveNr: byte; var Dir: Unicodestring);
|
procedure do_GetDir (DriveNr: byte; var Dir: Unicodestring);
|
||||||
{$ifndef WINCE}
|
{$ifndef WINCE}
|
||||||
var
|
var
|
||||||
Drive:array[0..3]of char;
|
Drive:array[0..3]of widechar;
|
||||||
defaultdrive:boolean;
|
defaultdrive:boolean;
|
||||||
savebuf: UnicodeString;
|
savebuf: UnicodeString;
|
||||||
len : integer;
|
len : integer;
|
||||||
@ -97,7 +97,7 @@ begin
|
|||||||
errno := word (GetLastError);
|
errno := word (GetLastError);
|
||||||
Errno2InoutRes;
|
Errno2InoutRes;
|
||||||
Dir := widechar (DriveNr + 64) + ':\';
|
Dir := widechar (DriveNr + 64) + ':\';
|
||||||
SetCurrentDirectoryW(@SaveBuf);
|
SetCurrentDirectoryW(punicodechar(SaveBuf));
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -106,7 +106,7 @@ begin
|
|||||||
setlength(dir,len-1); // -1 because len is #0 inclusive
|
setlength(dir,len-1); // -1 because len is #0 inclusive
|
||||||
GetCurrentDirectoryW(len,punicodechar(dir));
|
GetCurrentDirectoryW(len,punicodechar(dir));
|
||||||
if not defaultdrive then
|
if not defaultdrive then
|
||||||
SetCurrentDirectoryW(@SaveBuf);
|
SetCurrentDirectoryW(punicodechar(SaveBuf));
|
||||||
if not FileNameCasePreserving then
|
if not FileNameCasePreserving then
|
||||||
dir:=upcase(dir);
|
dir:=upcase(dir);
|
||||||
{$else WINCE}
|
{$else WINCE}
|
||||||
|
Loading…
Reference in New Issue
Block a user