[newlib-cygwin] dlopen (pathfinder): try each basename per dir

Corinna Vinschen corinna@sourceware.org
Thu Sep 8 11:56:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b37c3ed5e57e528adf73548882cf252a79c014dd

commit b37c3ed5e57e528adf73548882cf252a79c014dd
Author: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
Date:   Wed Aug 31 20:07:07 2016 +0200

    dlopen (pathfinder): try each basename per dir
    
    Rather than searching all search dirs per one basename,
    search for all basenames within per one search dir.
    
    pathfinder.h (check_path_access): Interchange dir- and basename-loops.

Diff:
---
 winsup/cygwin/pathfinder.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/winsup/cygwin/pathfinder.h b/winsup/cygwin/pathfinder.h
index bbba168..c306604 100644
--- a/winsup/cygwin/pathfinder.h
+++ b/winsup/cygwin/pathfinder.h
@@ -182,12 +182,12 @@ public:
 	     basenamelist::member const ** found_basename = NULL)
   {
     char const * critname = criterion.name ();
-    for (basenamelist::iterator name = basenames_.begin ();
-	 name != basenames_.end ();
-	 ++name)
-      for (searchdirlist::iterator dir(searchdirs_.begin ());
-	   dir != searchdirs_.end ();
-	   ++dir)
+    for (searchdirlist::iterator dir(searchdirs_.begin ());
+	 dir != searchdirs_.end ();
+	 ++dir)
+      for (basenamelist::iterator name = basenames_.begin ();
+	   name != basenames_.end ();
+	   ++name)
 	if (criterion.test (dir, name))
 	  {
 	    debug_printf ("(%s), take %s%s", critname,



More information about the Cygwin-cvs mailing list