diff src/file-io.cc @ 6905:aee959a21c4b

[project @ 2007-09-17 16:00:30 by jwe]
author jwe
date Mon, 17 Sep 2007 16:00:30 +0000
parents 5e3350bdd91d
children 8b0cfeb06365
line wrap: on
line diff
--- a/src/file-io.cc	Fri Sep 14 20:08:57 2007 +0000
+++ b/src/file-io.cc	Mon Sep 17 16:00:30 2007 +0000
@@ -414,7 +414,6 @@
 		}
 	    }
 
-#if defined (HAVE_ZLIB)
 	  std::string tmode = mode;
 
 	  // Use binary mode if 't' is not specified, but don't add
@@ -426,6 +425,7 @@
 	  if (bpos == NPOS && tpos == NPOS)
 	    tmode += 'b';
 
+#if defined (HAVE_ZLIB)
 	  size_t pos = tmode.find ('z');
 
 	  if (pos != NPOS)
@@ -445,7 +445,7 @@
 	  else
 #endif
 	    {
-	      FILE *fptr = ::fopen (fname.c_str (), mode.c_str ());
+	      FILE *fptr = ::fopen (fname.c_str (), tmode.c_str ());
 
 	      retval = octave_stdiostream::create (fname, fptr, md, flt_fmt);