OSDN Git Service

* path.cc (read_mounts): Skip unnecessary test if path has been
authorcorinna <corinna>
Thu, 5 Nov 2009 02:09:32 +0000 (02:09 +0000)
committercorinna <corinna>
Thu, 5 Nov 2009 02:09:32 +0000 (02:09 +0000)
fetched from loaded cygwin1.dll.

winsup/utils/ChangeLog
winsup/utils/path.cc

index 398670d..e019dfb 100644 (file)
@@ -1,5 +1,10 @@
 2009-11-04  Corinna Vinschen  <corinna@vinschen.de>
 
+       * path.cc (read_mounts): Skip unnecessary test if path has been
+       fetched from loaded cygwin1.dll.
+
+2009-11-04  Corinna Vinschen  <corinna@vinschen.de>
+
        * cygcheck.cc (cygwin_dll_path): New global variable.
        (load_cygwin): Fetch cygwin DLL path and store in cygwin_dll_path.
        * strace.cc: Full ditto.
index 34001f0..0360119 100644 (file)
@@ -594,12 +594,16 @@ read_mounts ()
   path_end = wcsrchr (path, L'\\');
   if (path_end)
     {
-      wcscpy (path_end, L"\\cygwin1.dll");
-      DWORD attr = GetFileAttributesW (path);
-      if (attr == (DWORD) -1
-         || (attr & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT)))
-       path_end = NULL;
-      else
+      if (!cygwin_dll_path[0])
+       {
+         wcscpy (path_end, L"\\cygwin1.dll");
+         DWORD attr = GetFileAttributesW (path);
+         if (attr == (DWORD) -1
+             || (attr & (FILE_ATTRIBUTE_DIRECTORY
+                         | FILE_ATTRIBUTE_REPARSE_POINT)))
+           path_end = NULL;
+       }
+      if (path_end)
        {
          *path_end = L'\0';
          path_end = wcsrchr (path, L'\\');