diff options
author | Christopher Faylor <me@cgf.cx> | 2006-01-19 20:17:11 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-01-19 20:17:11 +0000 |
commit | 101b3cb01a16381f91f5d33a40d6a45a076c4f04 (patch) | |
tree | e06593dda569497408426fee03b27ba464d2ebaa /winsup/utils | |
parent | ecd4fba2731dac85dbd8a49e06c960e39e9fd099 (diff) | |
download | cygnal-101b3cb01a16381f91f5d33a40d6a45a076c4f04.tar.gz cygnal-101b3cb01a16381f91f5d33a40d6a45a076c4f04.tar.bz2 cygnal-101b3cb01a16381f91f5d33a40d6a45a076c4f04.zip |
* cygcheck.cc (init_paths): Record first_nonsys_path.
(find_on_path): Start on first nonsys path when !search_sysdirs.
Diffstat (limited to 'winsup/utils')
-rw-r--r-- | winsup/utils/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/utils/cygcheck.cc | 16 |
2 files changed, 13 insertions, 8 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 51023600e..3eddc5824 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +2006-01-19 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (init_paths): Record first_nonsys_path. + (find_on_path): Start on first nonsys path when !search_sysdirs. + 2006-01-18 Christopher Faylor <cgf@timesys.com> * Makefile.in (sysconfdir): Remove unneeded variable. diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 90b66091d..db80e4c47 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -112,8 +112,9 @@ static common_apps[] = { {0, 0} }; -static int num_paths = 0, max_paths = 0; -static char **paths = 0; +static int num_paths, max_paths; +static char **paths; +int first_nonsys_path; void eprintf (const char *format, ...) @@ -226,9 +227,12 @@ init_paths () } GetWindowsDirectory (tmp, 4000); add_path (tmp, strlen (tmp)); + first_nonsys_path = num_paths; char *wpath = getenv ("PATH"); - if (wpath) + if (!wpath) + fprintf (stderr, "WARNING: PATH is not set at all!\n"); + else { char *b, *e; b = wpath; @@ -242,8 +246,6 @@ init_paths () b = e + 1; } } - else - printf ("WARNING: PATH is not set at all!\n"); } static char * @@ -278,10 +280,8 @@ find_on_path (char *file, char *default_extension, if (strchr (file, '.')) default_extension = (char *) ""; - for (int i = 0; i < num_paths; i++) + for (int i = search_sysdirs ? 0 : first_nonsys_path; i < num_paths; i++) { - if (!search_sysdirs && (i == 0 || i == 2 || i == 3)) - continue; if (i == 0 || !search_sysdirs || strcasecmp (paths[i], paths[0])) { sprintf (ptr, "%s\\%s%s", paths[i], file, default_extension); |