aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-06-22 12:07:05 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-22 12:07:05 +0200
commit47d3b920ce09b27fca7dc6504640f6fe72fb16cf (patch)
tree817abe2e078de21d449193162217e6853732d04c /gcc/ada/adaint.c
parent5c52bf3ba490639455d1ce816c2b2004bd3c65da (diff)
downloadgcc-47d3b920ce09b27fca7dc6504640f6fe72fb16cf.zip
gcc-47d3b920ce09b27fca7dc6504640f6fe72fb16cf.tar.gz
gcc-47d3b920ce09b27fca7dc6504640f6fe72fb16cf.tar.bz2
[multiple changes]
2010-06-22 Robert Dewar <dewar@adacore.com> * lib-writ.ads, errout.adb, einfo.adb, einfo.ads: Minor reformatting. 2010-06-22 Vincent Celier <celier@adacore.com> * adaint.c (__gnat_locate_regular_file): If a directory in the path is empty, make it the current working directory. 2010-06-22 Thomas Quinot <quinot@adacore.com> * sem_ch3.adb (Build_Derived_Record_Type): When deriving a tagged private type with discriminants, make sure the parent type is frozen. 2010-06-22 Eric Botcazou <ebotcazou@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference) <Attribute_Bit>: Deal with packed array references specially. * exp_ch4.adb (Expand_N_Indexed_Component): Do not convert a reference to a component of a bit packed array if it is the prefix of 'Bit. * exp_pakd.ads (Expand_Packed_Bit_Reference): Declare. * exp_pakd.adb (Expand_Packed_Bit_Reference): New procedure. Expand a 'Bit reference, where the prefix involves a packed array reference. (Get_Base_And_Bit_Offset): New helper, extracted from... (Expand_Packed_Address_Reference): ...here. Call above procedure to get the outer object and offset expression. From-SVN: r161160
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 5ceedd0..9379950 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -2788,12 +2788,6 @@ __gnat_locate_regular_file (char *file_name, char *path_val)
for (;;)
{
- for (; *path_val == PATH_SEPARATOR; path_val++)
- ;
-
- if (*path_val == 0)
- return 0;
-
/* Skip the starting quote */
if (*path_val == '"')
@@ -2802,7 +2796,14 @@ __gnat_locate_regular_file (char *file_name, char *path_val)
for (ptr = file_path; *path_val && *path_val != PATH_SEPARATOR; )
*ptr++ = *path_val++;
- ptr--;
+ /* If directory is empty, it is the current directory*/
+
+ if (ptr == file_path)
+ {
+ *ptr = '.';
+ }
+ else
+ ptr--;
/* Skip the ending quote */
@@ -2816,6 +2817,13 @@ __gnat_locate_regular_file (char *file_name, char *path_val)
if (__gnat_is_regular_file (file_path))
return xstrdup (file_path);
+
+ if (*path_val == 0)
+ return 0;
+
+ /* Skip path separator */
+
+ path_val++;
}
}