[vlc-commits] Win32: assume binary file open mode by default

Rémi Denis-Courmont git at videolan.org
Tue Nov 22 17:17:53 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 22 18:04:52 2011 +0200| [709b755fa8c4a91c876179ce318ea55b676506c5] | committer: Rémi Denis-Courmont

Win32: assume binary file open mode by default

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=709b755fa8c4a91c876179ce318ea55b676506c5
---

 src/text/filesystem.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/text/filesystem.c b/src/text/filesystem.c
index 2e5f26e..11f1c99 100644
--- a/src/text/filesystem.c
+++ b/src/text/filesystem.c
@@ -52,6 +52,10 @@ FILE *vlc_fopen (const char *filename, const char *mode)
 {
     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++)
     {
         switch (*ptr)
@@ -74,7 +78,7 @@ FILE *vlc_fopen (const char *filename, const char *mode)
                 rwflags = O_RDWR;
                 break;
 
-#ifdef O_TEXT
+#ifdef O_BINARY
             case 'b':
                 oflags = (oflags & ~O_TEXT) | O_BINARY;
                 break;



More information about the vlc-commits mailing list