1 with Opt28_Pkg
; use Opt28_Pkg
;
5 function Full_Filename
(Filename
: String) return String is
6 Path
: constant String := "PATH";
7 Posix_Path
: constant Posix_String
:= To_Posix
(Path
);
11 M
: constant Posix_String
:= Value_Of
(Posix_Path
);
12 N
: constant Posix_String
(1 .. M
'Length) := M
;
13 Var
: constant String := To_String
(Str
=> N
);
14 Start_Pos
: Natural := 1;
15 End_Pos
: Natural := 1;
17 while Start_Pos
<= Var
'Length loop
18 End_Pos
:= Position
(Var
(Start_Pos
.. Var
'Length));
20 if Is_File
(To_Posix
(Var
(Start_Pos
.. End_Pos
- 1) & Filename
)) then
21 return Var
(Start_Pos
.. End_Pos
- 1) & Filename
;
23 Start_Pos
:= End_Pos
+ 1;