Commit 454ff542 by Doug Rupp Committed by Arnaud Charlet

gnatchop.adb (Locate_Executable): Normalize the possibly VMS style Command_Name.

2005-03-08  Doug Rupp  <rupp@adacore.com>

	* gnatchop.adb (Locate_Executable): Normalize the possibly VMS style
	Command_Name.

From-SVN: r96498
parent 6e40e481
...@@ -521,17 +521,19 @@ procedure Gnatchop is ...@@ -521,17 +521,19 @@ procedure Gnatchop is
function Locate_Executable function Locate_Executable
(Program_Name : String; (Program_Name : String;
Look_For_Prefix : Boolean := True) Look_For_Prefix : Boolean := True) return String_Access
return String_Access
is is
Current_Command : constant String := Command_Name; Current_Command : constant String := Normalize_Pathname (Command_Name);
End_Of_Prefix : Natural := Current_Command'First - 1; End_Of_Prefix : Natural;
Start_Of_Prefix : Positive := Current_Command'First; Start_Of_Prefix : Positive;
Result : String_Access; Result : String_Access;
begin begin
Start_Of_Prefix := Current_Command'First;
End_Of_Prefix := Start_Of_Prefix - 1;
if Look_For_Prefix then if Look_For_Prefix then
-- Find Start_Of_Prefix -- Find Start_Of_Prefix
for J in reverse Current_Command'Range loop for J in reverse Current_Command'Range loop
...@@ -546,8 +548,6 @@ procedure Gnatchop is ...@@ -546,8 +548,6 @@ procedure Gnatchop is
-- Find End_Of_Prefix -- Find End_Of_Prefix
End_Of_Prefix := Start_Of_Prefix - 1;
for J in reverse Start_Of_Prefix .. Current_Command'Last loop for J in reverse Start_Of_Prefix .. Current_Command'Last loop
if Current_Command (J) = '-' then if Current_Command (J) = '-' then
End_Of_Prefix := J; End_Of_Prefix := J;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment