fpmkunit - TDependencies.AddInclude doesn't actually change file extension if needed
Original Reporter info from Mantis: ccrause @ccrause
-
Reporter name: Christo Crause
Original Reporter info from Mantis: ccrause @ccrause
- Reporter name: Christo Crause
Description:
The method TDependencies.AddInclude has functionality to append '.inc' to the file name passed into the method if it doesn't have a file extension by using the ChangeFileExt function. Note that the result of the changed filename needs to be assigned to a variable, but this isn't done. Refer to the code below from fpmkunit.pp
Steps to reproduce:
Function TDependencies.AddInclude(Const Value : String;const CPUs:TCPUs;const OSes:TOSes) : TDependency;
Var
N : String;
begin
N:=FixPath(Value, False);
if ExtractFileExt(N)='' then
ChangeFileExt(N,IncExt); << notice that function value is not assigned to N
Additional information:
The fix is simple:
if ExtractFileExt(N)='' then
N := ChangeFileExt(N,IncExt);
Mantis conversion info:
- Mantis ID: 34241
- Version: 3.1.1
- Fixed in version: 3.3.1
- Fixed in revision: 39713 (#2d1ea807)
- Target version: 3.2.0