From 0f0595abd921e2593f780bec34a0d89e872be6ca Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 24 Mar 2005 14:48:15 +0000 Subject: * cygcheck.cc (init_paths): Use full path instead of "." for the current directory. Do not add "." if present in $PATH. (dump_sysinfo): Skip placeholder first value of paths[]. --- winsup/utils/ChangeLog | 6 ++++++ winsup/utils/cygcheck.cc | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'winsup/utils') diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 599f39d4e..ad035a3ef 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,9 @@ +2005-03-24 Brian Dessent + + * cygcheck.cc (init_paths): Use full path instead of "." for the + current directory. Do not add "." if present in $PATH. + (dump_sysinfo): Skip placeholder first value of paths[]. + 2005-03-07 Christopher Faylor * kill.cc (getsig): Rectify bug introduced by 2005-02-26 change. Don't diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index b19629680..c8bcff600 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -158,7 +158,12 @@ init_paths () { char tmp[4000], *sl; add_path ((char *) ".", 1); /* to be replaced later */ - add_path ((char *) ".", 1); /* the current directory */ + + if (GetCurrentDirectory (4000, tmp)) + add_path (tmp, strlen (tmp)); + else + display_error ("init_paths: GetCurrentDirectory()"); + if (GetSystemDirectory (tmp, 4000)) add_path (tmp, strlen (tmp)); else @@ -180,7 +185,8 @@ init_paths () while (1) { for (e = b; *e && *e != ';'; e++); - add_path (b, e - b); + if (strncmp(b, ".", 1) && strncmp(b, ".\\", 2)) + add_path (b, e - b); if (!*e) break; b = e + 1; @@ -1237,7 +1243,7 @@ dump_sysinfo () if (givehelp) printf ("Looking for various Cygnus DLLs... (-v gives version info)\n"); int cygwin_dll_count = 0; - for (i = 0; i < num_paths; i++) + for (i = 1; i < num_paths; i++) { WIN32_FIND_DATA ffinfo; sprintf (tmp, "%s/*.*", paths[i]); -- cgit v1.2.3