aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 10:08:31 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 10:08:31 +0200
commit53f29d4f64e462e90aff1a949ab7f06f8e342c49 (patch)
treebb4f13cfd5b8f50ab21047b09be02e43f7f6a8e6 /gcc/ada/adaint.c
parentc0b118502029cede7f7fe9fa16bae5ff936ac461 (diff)
downloadgcc-53f29d4f64e462e90aff1a949ab7f06f8e342c49.zip
gcc-53f29d4f64e462e90aff1a949ab7f06f8e342c49.tar.gz
gcc-53f29d4f64e462e90aff1a949ab7f06f8e342c49.tar.bz2
[multiple changes]
2011-08-03 Robert Dewar <dewar@adacore.com> * sem_ch3.adb, sem_res.adb, exp_ch13.adb, exp_disp.adb, exp_aggr.adb: Minor reformatting. 2011-08-03 Thomas Quinot <quinot@adacore.com> * exp_ch5.adb (Expand_N_Assignment_Statement): Do not force inlining of tagged assignment when discriminant checks are suppressed. This is useless and extremely costly in terms of static stack usage. 2011-08-03 Bob Duff <duff@adacore.com> * sem_prag.adb (Get_Base_Subprogram): Do not follow Alias for instances of generics, because this leads to the wrong entity in the wrong scope, causing (e.g.) pragma Export_Procedure to get an error if the entity is an instance. (Process_Interface_Name): Follow Alias for instances of generics, to correct for the above change. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * exp_ch4.adb (Expand_N_Selected_Component): If the discriminant value is an integer literal it is always safe to replace the reference. In addition, if the reference appears in the generated code for an object declaration it is necessary to copy because otherwise the reference might be to the uninitilized value of the discriminant of the object itself. 2011-08-03 Pascal Obry <obry@adacore.com> * adaint.c (__gnat_is_executable_file_attr): Fix Win32 circuitry when no ACL used, in this case we want to check for ending .exe, not .exe anywhere in the path. 2011-08-03 Sergey Rybin <rybin@adacore.com> * tree_io.ads (ASIS_Version_Number): Update because of the changes in the tree structure (semantic decoration of references to record discriminants). From-SVN: r177237
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index bfaa31a..6845ff0 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -2145,8 +2145,15 @@ __gnat_is_executable_file_attr (char* name, struct file_attributes* attr)
__gnat_check_OWNER_ACL (wname, FILE_EXECUTE, GenericMapping);
}
else
- attr->executable = GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES
- && _tcsstr (wname, _T(".exe")) - wname == (int) (_tcslen (wname) - 4);
+ {
+ TCHAR *l, *last = _tcsstr(wname, _T(".exe"));
+
+ /* look for last .exe */
+ while (l = _tcsstr(last+1, _T(".exe"))) last = l;
+
+ attr->executable = GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES
+ && last - wname == (int) (_tcslen (wname) - 4);
+ }
#else
__gnat_stat_to_attr (-1, name, attr);
#endif