* Fixed bug #6491, fileextdrive

git-svn-id: trunk@3560 -
This commit is contained in:
michael 2006-05-18 12:45:03 +00:00
parent b1cae757a5
commit b9a0fae596

View File

@ -53,20 +53,26 @@ Result := Copy(FileName, 1, I);
end; end;
function ExtractFileDrive(const FileName: string): string; function ExtractFileDrive(const FileName: string): string;
var i: longint;
var
i,l: longint;
begin begin
if (Length(FileName) >= 2) and (FileName[2] = ':') then Result := '';
result := Copy(FileName, 1, 2) l:=Length(FileName);
else if (Length(FileName) >= 2) and (FileName[1] in ['/', '\']) and if (L>=2) then
(FileName[2] in ['/', '\']) then begin begin
i := 2; If (FileName[2]=':') then
While (i < Length(Filename)) do begin result:=Copy(FileName,1,2)
if Filename[i + 1] in ['/', '\'] then break; else if (FileName[1] in ['/','\']) and
inc(i); (FileName[2] in ['/','\']) then
end ; begin
Result := Copy(FileName, 1, i); i := 2;
end While (i<L) and Not (Filename[i+1] in ['/', '\']) do
else Result := ''; inc(i);
Result:=Copy(FileName,1,i);
end;
end;
end; end;
function ExtractFileName(const FileName: string): string; function ExtractFileName(const FileName: string): string;