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>2006-01-19 23:17:11 +0300
committerChristopher Faylor <me@cgf.cx>2006-01-19 23:17:11 +0300
commit101b3cb01a16381f91f5d33a40d6a45a076c4f04 (patch)
treee06593dda569497408426fee03b27ba464d2ebaa /winsup/utils/cygcheck.cc
parentecd4fba2731dac85dbd8a49e06c960e39e9fd099 (diff)
* cygcheck.cc (init_paths): Record first_nonsys_path.
(find_on_path): Start on first nonsys path when !search_sysdirs.
Diffstat (limited to 'winsup/utils/cygcheck.cc')
-rw-r--r--winsup/utils/cygcheck.cc16
1 files changed, 8 insertions, 8 deletions
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);