Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / bfdio.c
index 9e88f5be9150fda1d8ff3bd83ab17f165350d884..0133b76064a6f6c94f4763989799c154e01e756c 100644 (file)
@@ -120,13 +120,22 @@ _bfd_real_fopen (const char *filename, const char *modes)
 
   if (filelen > MAX_PATH - 1)
     {
-      FILE *file;
-      char* fullpath = (char *) malloc (filelen + 8);
+      FILE * file;
+      char * fullpath = (char *) malloc (filelen + 8);
+      int    i;
 
       /* Add a Microsoft recommended prefix that
         will allow the extra-long path to work.  */
       strcpy (fullpath, "\\\\?\\");
       strcat (fullpath, filename);
+
+      /* Convert any UNIX style path separators into the DOS form.  */
+      for (i = 0; fullpath[i]; i++)
+        {
+          if (IS_UNIX_DIR_SEPARATOR (fullpath[i]))
+           fullpath[i] = '\\';
+        }
+
       file = close_on_exec (fopen (fullpath, modes));
       free (fullpath);
       return file;
@@ -201,6 +210,7 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd)
       offset += abfd->origin;
       abfd = abfd->my_archive;
     }
+  offset += abfd->origin;
 
   /* If this is an archive element, don't read past the end of
      this element.  */
@@ -270,6 +280,7 @@ bfd_tell (bfd *abfd)
       offset += abfd->origin;
       abfd = abfd->my_archive;
     }
+  offset += abfd->origin;
 
   if (abfd->iovec == NULL)
     return 0;
@@ -330,6 +341,7 @@ bfd_seek (bfd *abfd, file_ptr position, int direction)
       offset += abfd->origin;
       abfd = abfd->my_archive;
     }
+  offset += abfd->origin;
 
   if (abfd->iovec == NULL)
     {
@@ -522,6 +534,7 @@ bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
       offset += abfd->origin;
       abfd = abfd->my_archive;
     }
+  offset += abfd->origin;
 
   if (abfd->iovec == NULL)
     {
This page took 0.024059 seconds and 4 git commands to generate.