[vlc-commits] vlc_fopen: implement binary mode (useful on Windows)

Rémi Denis-Courmont git at videolan.org
Thu Nov 3 19:03:22 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Nov  3 19:20:40 2011 +0200| [19cc40ec00cf1cd82d7aefe33bca21d3ab3ca72f] | committer: Rémi Denis-Courmont

vlc_fopen: implement binary mode (useful on Windows)

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

 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 78f088e..21d58dd 100644
--- a/src/text/filesystem.c
+++ b/src/text/filesystem.c
@@ -77,8 +77,12 @@ FILE *vlc_fopen (const char *filename, const char *mode)
                 break;
 
 #ifdef O_TEXT
+            case 'b':
+                oflags = (oflags & ~O_TEXT) | O_BINARY;
+                break;
+
             case 't':
-                oflags |= O_TEXT;
+                oflags = (oflags & ~O_BINARY) | O_TEXT;
                 break;
 #endif
         }



More information about the vlc-commits mailing list