mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 06:29:29 +02:00
FpDebug: Win, Fix dropping last char of dll names.
git-svn-id: trunk@62341 -
This commit is contained in:
parent
b34bc4a730
commit
42eb28852f
@ -384,19 +384,17 @@ begin
|
|||||||
|
|
||||||
// GetFinalPathNameByHandle is only available on Windows Vista / Server 2008
|
// GetFinalPathNameByHandle is only available on Windows Vista / Server 2008
|
||||||
if assigned(_GetFinalPathNameByHandle) then begin
|
if assigned(_GetFinalPathNameByHandle) then begin
|
||||||
SetLength(u, MAX_PATH);
|
SetLength(u, MAX_PATH+1);
|
||||||
|
|
||||||
len := _GetFinalPathNameByHandle(AModuleHandle, @u[1], MAX_PATH, 0);
|
len := _GetFinalPathNameByHandle(AModuleHandle, @u[1], MAX_PATH, 0);
|
||||||
s:='';
|
s:='';
|
||||||
if len > 0
|
if len > 0
|
||||||
then begin
|
then begin
|
||||||
SetLength(u, len - 1);
|
// On some older Windows versions there's a bug in GetFinalPathNameByHandleW,
|
||||||
if (u<>'') and (u[length(u)]=#0) then
|
// which leads to a trailing #0.
|
||||||
begin
|
if (u[len]=#0) then
|
||||||
// On some older Windows versions there's a bug in GetFinalPathNameByHandleW,
|
dec(len);
|
||||||
// which leads to a trailing #0.
|
SetLength(u, len);
|
||||||
Delete(u,length(u),1);
|
|
||||||
end;
|
|
||||||
s:=UTF8Encode(u);
|
s:=UTF8Encode(u);
|
||||||
end else begin
|
end else begin
|
||||||
u := '';
|
u := '';
|
||||||
|
Loading…
Reference in New Issue
Block a user