From 5c1ba4cc9cd83595d4f327fe2e5fc0ab1f1222cf Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Thu, 25 Oct 2001 23:12:24 +0000 Subject: [PATCH] g-dirope.adb (Basename): correctly compute offset between the original Path and the translated one. * g-dirope.adb (Basename): correctly compute offset between the original Path and the translated one. * g-dirope.adb: (Base_Name): add some comments. From-SVN: r46502 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/g-dirope.adb | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c1211eafde4..0790bbd53b3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2001-10-25 Pascal Obry + + * g-dirope.adb (Basename): correctly compute offset between the + original Path and the translated one. + + * g-dirope.adb: (Base_Name): add some comments. + 2001-10-25 Robert Dewar * exp_imgv.adb (Expand_Image_Attribute): Defend against bad use diff --git a/gcc/ada/g-dirope.adb b/gcc/ada/g-dirope.adb index d73d9a02005..afa996c56b2 100644 --- a/gcc/ada/g-dirope.adb +++ b/gcc/ada/g-dirope.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- $Revision: 1.15 $ +-- $Revision$ -- -- -- Copyright (C) 1998-2001 Ada Core Technologies, Inc. -- -- -- @@ -122,7 +122,10 @@ package body GNAT.Directory_Operations is end if; Check_For_Standard_Dirs : declare - BN : constant String := Base_Name.Path (Cut_Start .. Cut_End); + 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