Skip to content

Commit 2a77485

Browse files
committed
Fix the project relative file fetching
This function was wrongly implemented because it was concatenating the CLI provided '-P' option with the required file-name. Thus, when using a project located in the 'GPR_PROJECT_PATH', the file fetching was invalid. This fix is required for later commit in the same MR.
1 parent a9d5802 commit 2a77485

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lkql_checker/src/gnatcheck-projects.adb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,13 @@ package body Gnatcheck.Projects is
369369
(My_Project : Arg_Project_Type;
370370
Filename : String) return String is
371371
begin
372-
if Gnatcheck.Options.Gnatcheck_Prj.Is_Specified then
372+
if Gnatcheck.Options.Gnatcheck_Prj.Is_Specified
373+
and then Gnatcheck.Options.Gnatcheck_Prj.Tree.Is_Defined
374+
then
373375
return Normalize_Pathname
374376
(GNAT.Directory_Operations.Dir_Name
375-
(Gnatcheck.Options.Gnatcheck_Prj.Source_Prj.all) & Filename);
377+
(Gnatcheck_Prj.Tree.Root_Project.Path_Name.String_Value) &
378+
Filename);
376379
else
377380
return Normalize_Pathname (Filename);
378381
end if;

0 commit comments

Comments
 (0)