]> sourceware.org Git - newlib-cygwin.git/commitdiff
* path.cc (normalize_win32_path): Reorganize logic to accomodate chroot.
authorChristopher Faylor <me@cgf.cx>
Sat, 9 Dec 2000 03:29:33 +0000 (03:29 +0000)
committerChristopher Faylor <me@cgf.cx>
Sat, 9 Dec 2000 03:29:33 +0000 (03:29 +0000)
Always check for MAX_PATH overrun.  Avoid adding one too many backslashes when
src path begins with a slash.  From Corinna Vinschen.
* winsup.h: Force demangling for dll_crt0 for newer compilers.

winsup/cygwin/ChangeLog
winsup/cygwin/path.cc
winsup/cygwin/winsup.h

index 1287603b5a5d1aa6b8e99747581a23925092cf54..7bec39a0aed78bee69a6588bf6c22166e1a5fc40 100644 (file)
@@ -1,3 +1,10 @@
+Fri Dec  8 22:21:01 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * path.cc (normalize_win32_path): Reorganize logic to accomodate
+       chroot.  Always check for MAX_PATH overrun.  Avoid adding one too many
+       backslashes when src path begins with a slash.  From Corinna Vinschen.
+       * winsup.h: Force demangling for dll_crt0 for newer compilers.
+
 Thu Dec 7 12:10:00 2000  Edward M. Lee  <tailbert@yahoo.com>
 
        * cygwin.din: Declare strtok_r for the import lib. Already in the DLL.
index b00b1ae8f7eba4898a12b098a9fce70cbc4ed857..7b9f81f6ef84847c84ee95ba839bb7b9cbab2092 100644 (file)
@@ -712,32 +712,9 @@ normalize_win32_path (const char *src, char *dst)
   const char *src_start = src;
   char *dst_start = dst;
   char *dst_root_start = dst;
+  bool beg_src_slash;
 
-  if (strchr (src, ':') == NULL && !slash_unc_prefix_p (src))
-    {
-      if (!cygcwd.get (dst, 0))
-       return get_errno ();
-      if (SLASH_P (src[0]))
-       if (dst[1] == ':')
-         dst[2] = '\0';
-       else if (slash_unc_prefix_p (dst))
-         {
-           char *p = strpbrk (dst + 2, "\\/");
-           if (p && (p = strpbrk (p + 1, "\\/")))
-               *p = '\0';
-         }
-       
-      else if (strlen (dst) + 1 + strlen (src) >= MAX_PATH)
-       {
-         debug_printf ("ENAMETOOLONG = normalize_win32_path (%s)", src);
-         return ENAMETOOLONG;
-       }
-      dst += strlen (dst);
-      if (!SLASH_P (dst[-1]))
-       *dst++ = '\\';
-    }
-  /* Two leading \'s?  If so, preserve them.  */
-  else if (SLASH_P (src[0]) && SLASH_P (src[1]))
+  if (slash_unc_prefix_p (src))
     {
       if (cygheap->root.length ())
        {
@@ -748,7 +725,7 @@ normalize_win32_path (const char *src, char *dst)
       ++src;
     }
   /* If absolute path, care for chroot. */
-  else if (SLASH_P (src[0]) && !SLASH_P (src[1]) && cygheap->root.length ())
+  else if ((beg_src_slash = SLASH_P (src[0])) && cygheap->root.length ())
     {
       strcpy (dst, cygheap->root.path ());
       char *c;
@@ -758,6 +735,30 @@ normalize_win32_path (const char *src, char *dst)
       dst_root_start = dst;
       *dst++ = '\\';
     }
+  else if (strchr (src, ':') == NULL)
+    {
+      if (!cygcwd.get (dst, 0))
+       return get_errno ();
+      if (beg_src_slash)
+       {
+         if (dst[1] == ':')
+           dst[2] = '\0';
+         else if (slash_unc_prefix_p (dst))
+           {
+             char *p = strpbrk (dst + 2, "\\/");
+             if (p && (p = strpbrk (p + 1, "\\/")))
+                 *p = '\0';
+           }
+       }
+      if (strlen (dst) + 1 + strlen (src) >= MAX_PATH)
+       {
+         debug_printf ("ENAMETOOLONG = normalize_win32_path (%s)", src);
+         return ENAMETOOLONG;
+       }
+      dst += strlen (dst);
+      if (!beg_src_slash)
+       *dst++ = '\\';
+    }
 
   while (*src)
     {
index 29cf92d11314c5304c92fc26adea8c42641b7982..308620e348811f891a74fdf3c074136dc7bffb8b 100644 (file)
@@ -146,7 +146,7 @@ extern unsigned int signal_shift_subtract;
 
 class per_process;
 /* cygwin .dll initialization */
-void dll_crt0 (per_process *);
+void dll_crt0 (per_process *) __asm__ ("_dll_crt0__FP11per_process");
 extern "C" void __stdcall _dll_crt0 ();
 
 /* dynamically loaded dll initialization */
This page took 0.035608 seconds and 5 git commands to generate.