Commit 709b755f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Win32: assume binary file open mode by default

parent c0d92ebe
...@@ -52,6 +52,10 @@ FILE *vlc_fopen (const char *filename, const char *mode) ...@@ -52,6 +52,10 @@ FILE *vlc_fopen (const char *filename, const char *mode)
{ {
int rwflags = 0, oflags = 0; int rwflags = 0, oflags = 0;
#ifdef O_BINARY
/* Assume binary mode by default (i.e. no translation) */
oflags |= O_BINARY;
#endif
for (const char *ptr = mode; *ptr; ptr++) for (const char *ptr = mode; *ptr; ptr++)
{ {
switch (*ptr) switch (*ptr)
...@@ -74,7 +78,7 @@ FILE *vlc_fopen (const char *filename, const char *mode) ...@@ -74,7 +78,7 @@ FILE *vlc_fopen (const char *filename, const char *mode)
rwflags = O_RDWR; rwflags = O_RDWR;
break; break;
#ifdef O_TEXT #ifdef O_BINARY
case 'b': case 'b':
oflags = (oflags & ~O_TEXT) | O_BINARY; oflags = (oflags & ~O_TEXT) | O_BINARY;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment