Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-07-20 01:00:34 +0400
committerChristopher Faylor <me@cgf.cx>2005-07-20 01:00:34 +0400
commit0eccec28cc616e0d72ff308db4c2a6efa26092d5 (patch)
treed9e8a82c5908c7c327377367572d99df493113f8 /winsup/utils
parentfd745b00ed6fb782e9433f3cbc0abd2b3cfcbdad (diff)
* cygcheck.cc (find_on_path): Perform .exe magic on non-PATH search.
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog5
-rw-r--r--winsup/utils/cygcheck.cc9
2 files changed, 13 insertions, 1 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index bba38e9d8..55a63ee28 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-19 Christopher Faylor <cgf@timesys.com>
+ Eric Blake <ebb9@byu.net>
+
+ * cygcheck.cc (find_on_path): Perform .exe magic on non-PATH search.
+
2005-07-05 Eric Blake <ebb9@byu.net>
* cygcheck.cc (track_down, cygcheck): Return true on success.
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index ba1ee6f37..6db0d04e0 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -218,7 +218,14 @@ find_on_path (char *file, char *default_extension,
}
if (strchr (file, ':') || strchr (file, '\\') || strchr (file, '/'))
- return cygpath (file, NULL);
+ {
+ char *fn = cygpath (file, NULL);
+ if (access (fn, F_OK) == 0)
+ return fn;
+ strcpy (rv, fn);
+ strcat (rv, default_extension);
+ return access (rv, F_OK) == 0 ? rv : fn;
+ }
if (strchr (file, '.'))
default_extension = (char *) "";