git-svn-id: https://svn.code.sf.net/p/kolmck/code@47 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07

This commit is contained in:
dkolmck
2009-09-22 15:17:32 +00:00
parent 49a3a428b1
commit 9d26444098

19
KOL.pas
View File

@ -22384,16 +22384,17 @@ asm
CALL System.@LStrFromPCharLen CALL System.@LStrFromPCharLen
end; end;
{$ELSE} //Pascal {$ELSE} //Pascal
function ExtractFilePath( const Path : KOLString ) : KOLString; function ExtractFilePath(const Path: KOLString): KOLString;
//var I : Integer; var
var P, P0: PKOLChar; i: Integer;
begin begin
P0 := PKOLChar( Path ); for i := Length(Path) - 1 downto 1 do begin
P := __DelimiterLast( P0, ':\/' ); if (Path[i] = '\') then begin
if P^ = #0 then Result := Copy(Path, 1, i);
Result := '' Exit;
else end;
Result := Copy( Path, 1, P - P0 + 1 ); end;
Result := Path;
end; end;
{$ENDIF ASM_VERSION} {$ENDIF ASM_VERSION}