aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-os_lib.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-04-20 14:59:51 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-20 14:59:51 +0200
commitee9aa7b6637c3254a12f5887d9ca2b425543b5a0 (patch)
treeab7726b0a2ecb46134539f364db82c09ad20e775 /gcc/ada/s-os_lib.adb
parentbddd6058a2b9c29980962301b65a911985a3e00d (diff)
downloadgcc-ee9aa7b6637c3254a12f5887d9ca2b425543b5a0.zip
gcc-ee9aa7b6637c3254a12f5887d9ca2b425543b5a0.tar.gz
gcc-ee9aa7b6637c3254a12f5887d9ca2b425543b5a0.tar.bz2
[multiple changes]
2009-04-20 Javier Miranda <miranda@adacore.com> * sem_disp.adb (Find_Dispatching_Type): For subprograms internally generated by derivations of tagged types use the aliased subprogram a reference to locate their controlling type. 2009-04-20 Tristan Gingold <gingold@adacore.com> * g-trasym.adb: Set size of result buffer before calling convert_address. 2009-04-20 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Valid_Candidate): When checking whether a prefixed call to a function returning an array can be interpreted as a call with defaulted parameters whose result is indexed, take into account the types of all the indices of the array result type. 2009-04-20 Pascal Obry <obry@adacore.com> * a-direct.adb, s-os_lib.adb: Minor reformatting. From-SVN: r146411
Diffstat (limited to 'gcc/ada/s-os_lib.adb')
-rwxr-xr-xgcc/ada/s-os_lib.adb58
1 files changed, 34 insertions, 24 deletions
diff --git a/gcc/ada/s-os_lib.adb b/gcc/ada/s-os_lib.adb
index 163cfbf..41d1077 100755
--- a/gcc/ada/s-os_lib.adb
+++ b/gcc/ada/s-os_lib.adb
@@ -1833,8 +1833,8 @@ package body System.OS_Lib is
-- By default, the drive letter on Windows is in upper case
- if On_Windows and then Path_Len >= 2 and then
- Buffer (2) = ':'
+ if On_Windows and then Path_Len >= 2
+ and then Buffer (2) = ':'
then
System.Case_Util.To_Upper (Buffer (1 .. 1));
end if;
@@ -1906,31 +1906,41 @@ package body System.OS_Lib is
-- it may have multiple equivalences and if resolved we will only
-- get the first one.
- -- On Windows, if we have an absolute path starting with a directory
- -- separator, we need to have the drive letter appended in front.
+ if On_Windows then
- -- On Windows, Get_Current_Dir will return a suitable directory
- -- name (path starting with a drive letter on Windows). So we take this
- -- drive letter and prepend it to the current path.
+ -- On Windows, if we have an absolute path starting with a directory
+ -- separator, we need to have the drive letter appended in front.
- if On_Windows
- and then Path_Buffer (1) = Directory_Separator
- and then Path_Buffer (2) /= Directory_Separator
- then
- declare
- Cur_Dir : constant String := Get_Directory ("");
- -- Get the current directory to get the drive letter
+ -- On Windows, Get_Current_Dir will return a suitable directory name
+ -- (path starting with a drive letter on Windows). So we take this
+ -- drive letter and prepend it to the current path.
- begin
- if Cur_Dir'Length > 2
- and then Cur_Dir (Cur_Dir'First + 1) = ':'
- then
- Path_Buffer (3 .. End_Path + 2) := Path_Buffer (1 .. End_Path);
- Path_Buffer (1 .. 2) :=
- Cur_Dir (Cur_Dir'First .. Cur_Dir'First + 1);
- End_Path := End_Path + 2;
- end if;
- end;
+ if Path_Buffer (1) = Directory_Separator
+ and then Path_Buffer (2) /= Directory_Separator
+ then
+ declare
+ Cur_Dir : constant String := Get_Directory ("");
+ -- Get the current directory to get the drive letter
+
+ begin
+ if Cur_Dir'Length > 2
+ and then Cur_Dir (Cur_Dir'First + 1) = ':'
+ then
+ Path_Buffer (3 .. End_Path + 2) :=
+ Path_Buffer (1 .. End_Path);
+ Path_Buffer (1 .. 2) :=
+ Cur_Dir (Cur_Dir'First .. Cur_Dir'First + 1);
+ End_Path := End_Path + 2;
+ end if;
+ end;
+
+ -- We have a drive letter, ensure it is upper-case
+
+ elsif Path_Buffer (1) in 'a' .. 'z'
+ and then Path_Buffer (2) = ':'
+ then
+ System.Case_Util.To_Upper (Path_Buffer (1 .. 1));
+ end if;
end if;
-- On Windows, remove all double-quotes that are possibly part of the