changefileext
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
I think that this function is incorrect:
original file rtl\objpas\fina.inc
, now this is OK:
function ChangeFileExt(const FileName, Extension: string): string;
var i: longint;
begin
I := Length(FileName);
while (I > 0) and not(FileName[I] in ['/', '.', '', ':']) do Dec(I);
if (I = 0) or (FileName[I] <> '.') then
I := 256; // with 255,
{if length(filename)=255 ,then result will be copy(filename,1,254)+first char of extension: bad
Where's last char ? }
Result := Copy(FileName, 1, I - 1) + Extension;
end;
Additional information:
Reporter: Salvatore Licciardi
EMail: turylicciardi at tiscalinet dot it
Mantis conversion info:
- Mantis ID: 4205
- OS: All
- Version: 1.0.6
- Fixed in version: 1.0.7