mirror of
https://github.com/CloudDelphi/Virtual-File-System
synced 2025-12-19 09:53:54 +01:00
Fixed Externalize functions to always return allocated buffer, even if source is empty string
This commit is contained in:
parent
420ddd7c15
commit
84c569935d
@ -26,22 +26,14 @@ exports
|
||||
|
||||
function Externalize (const Str: AnsiString): {O} pointer; overload;
|
||||
begin
|
||||
result := nil;
|
||||
|
||||
if Str <> '' then begin
|
||||
GetMem(result, Length(Str) + 1);
|
||||
Utils.CopyMem(Length(Str) + 1, pointer(Str), result);
|
||||
end;
|
||||
GetMem(result, Length(Str) + 1);
|
||||
Utils.CopyMem(Length(Str) + 1, pchar(Str), result);
|
||||
end;
|
||||
|
||||
function Externalize (const Str: WideString): {O} pointer; overload;
|
||||
begin
|
||||
result := nil;
|
||||
|
||||
if Str <> '' then begin
|
||||
GetMem(result, (Length(Str) + 1) * sizeof(WideChar));
|
||||
Utils.CopyMem((Length(Str) + 1) * sizeof(WideChar), pointer(Str), result);
|
||||
end;
|
||||
GetMem(result, (Length(Str) + 1) * sizeof(WideChar));
|
||||
Utils.CopyMem((Length(Str) + 1) * sizeof(WideChar), PWideChar(Str), result);
|
||||
end;
|
||||
|
||||
function MapDir (const VirtPath, RealPath: PWideChar; OverwriteExisting: boolean; Flags: integer = 0): LONGBOOL; stdcall;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user