Browse Source

newline-mode binary should also turn off decoding of newlines on read

David Rose 17 years ago
parent
commit
d552ad28b7
1 changed files with 5 additions and 0 deletions
  1. 5 0
      dtool/src/dtoolutil/pandaFileStreamBuf.cxx

+ 5 - 0
dtool/src/dtoolutil/pandaFileStreamBuf.cxx

@@ -464,6 +464,11 @@ read_chars(char *start, size_t length) {
 
 
   // The file is opened in text mode.  We have to decode newline
   // The file is opened in text mode.  We have to decode newline
   // characters in the file.
   // characters in the file.
+  if (_newline_mode == NM_binary) {
+    // Unless we're configured to always use binary mode.
+    return read_chars_raw(start, length);
+  }
+
   char *buffer = (char *)alloca(length);
   char *buffer = (char *)alloca(length);
 
 
   size_t read_length;
   size_t read_length;