changeset 4537:6b7d8e93fc10

[project @ 2003-10-16 03:18:35 by jwe]
author jwe
date Thu, 16 Oct 2003 03:18:35 +0000
parents dcc6ac844587
children f855e276044c
files src/ChangeLog src/file-io.cc
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Oct 16 02:48:06 2003 +0000
+++ b/src/ChangeLog	Thu Oct 16 03:18:35 2003 +0000
@@ -1,5 +1,7 @@
 2003-10-15  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* file-io.cc (fopen_mode_to_ios_mode): Ignore "t" in mode string.
+
 	* strfns.cc (Fischar): rename from Fisstr.
 
 2003-10-09  John W. Eaton  <jwe@bevo.che.wisc.edu>
--- a/src/file-io.cc	Thu Oct 16 02:48:06 2003 +0000
+++ b/src/file-io.cc	Thu Oct 16 03:18:35 2003 +0000
@@ -101,12 +101,21 @@
 }
 
 static std::ios::openmode
-fopen_mode_to_ios_mode (const std::string& mode)
+fopen_mode_to_ios_mode (const std::string& mode_arg)
 {
   std::ios::openmode retval = std::ios::in;
 
-  if (! mode.empty ())
+  if (! mode_arg.empty ())
     {
+      std::string mode = mode_arg;
+
+      // Text mode doesn't matter (yet) for Octave.
+
+      size_t pos = mode.find ('t');
+
+      if (pos != NPOS)
+	mode.erase (pos);
+
       // Could probably be faster, but does it really matter?
 
       if (mode == "r")