+2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
+
+ PR 25713
+ * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
+ separators into DOS style when creating a WIN32 fullpath.
+
2020-05-14 Nelson Chu <nelson.chu@sifive.com>
* elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
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;