]> git.lizzy.rs Git - rust.git/commitdiff
Open files in binary mode. Closes #3948
authordarkf <lw9k123@gmail.com>
Mon, 5 Aug 2013 04:54:24 +0000 (21:54 -0700)
committerdarkf <lw9k123@gmail.com>
Mon, 5 Aug 2013 04:54:24 +0000 (21:54 -0700)
src/libstd/io.rs

index f750f3f3195e7157901ea67316de27da945b8352..55e60f03ea9c694f6126780a90ee3f951e0e69e4 100644 (file)
@@ -1041,7 +1041,7 @@ pub fn stdin() -> @Reader {
 
 pub fn file_reader(path: &Path) -> Result<@Reader, ~str> {
     let f = do path.to_str().as_c_str |pathbuf| {
-        do "r".as_c_str |modebuf| {
+        do "rb".as_c_str |modebuf| {
             unsafe { libc::fopen(pathbuf, modebuf as *libc::c_char) }
         }
     };