This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Ada] Fix bug in Base_Name (g-dirope)


Checked in for Pascal.

  -Geert

2001-10-25  Pascal Obry <obry@gnat.com>

	* g-dirope.adb (Basename): correctly compute offset between the 
        original Path and the translated one.
	
	* g-dirope.adb: (Base_Name): add some comments.

*** g-dirope.adb	2001/08/27 09:58:10	1.15
--- g-dirope.adb	2001/10/04 18:37:36	1.16
***************
*** 122,128 ****
           end if;
  
           Check_For_Standard_Dirs : declare
!             BN : constant String := Base_Name.Path (Cut_Start .. Cut_End);
  
           begin
              if BN = "." or else BN = ".." then
--- 122,130 ----
           end if;
  
           Check_For_Standard_Dirs : declare
!             Offset : constant Integer := Path'First - Base_Name.Path'First;
!             BN     : constant String  :=
!                        Base_Name.Path (Cut_Start - Offset .. Cut_End - Offset);
  
           begin
              if BN = "." or else BN = ".." then

*** g-dirope.adb	2001/10/04 18:37:36	1.16
--- g-dirope.adb	2001/10/05 17:23:09	1.17
***************
*** 125,130 ****
--- 125,131 ----
              Offset : constant Integer := Path'First - Base_Name.Path'First;
              BN     : constant String  :=
                         Base_Name.Path (Cut_Start - Offset .. Cut_End - Offset);
+             --  Here we use Base_Name.Path to keep the original casing
  
           begin
              if BN = "." or else BN = ".." then


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]