4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-18 04:19:21 +08:00

* cygcheck.cc (find_on_path): Perform .exe magic on non-PATH search.

This commit is contained in:
Christopher Faylor 2005-07-19 21:00:34 +00:00
parent fd745b00ed
commit 0eccec28cc
2 changed files with 13 additions and 1 deletions

View File

@ -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.

View File

@ -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 *) "";