This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] Two other thingies


Hi again,

another patchlet I like. Tested x86-linux.

Ok?

Paolo.

///////////
2003-05-03  Paolo Carlini  <pcarlini@unitus.it>

	* include/bits/fstream.tcc (_M_destroy_internal_buffer):
	Consistently with _M_allocate_internal_buffer, don't call
	setg and setp, _M_set_[in]determinate do.

	* include/bits/fstream.tcc (close): No need to call
	_M_destroy_pback, setting _M_pback_init to false suffices
	to clean up.
diff -urN libstdc++-v3-2/include/bits/fstream.tcc libstdc++-v3/include/bits/fstream.tcc
--- libstdc++-v3-2/include/bits/fstream.tcc	2003-04-29 21:46:07.000000000 +0200
+++ libstdc++-v3/include/bits/fstream.tcc	2003-05-03 20:31:35.000000000 +0200
@@ -67,8 +67,6 @@
 	  delete [] this->_M_buf;
 	  this->_M_buf = NULL;
 	  _M_buf_allocated = false;
-	  this->setg(NULL, NULL, NULL);
-	  this->setp(NULL, NULL);
 	}
     }
 
@@ -143,8 +141,8 @@
 	      
 	  // NB: Do this here so that re-opened filebufs will be cool...
 	  this->_M_mode = ios_base::openmode(0);
+	  this->_M_pback_init = false;
 	  _M_destroy_internal_buffer();
-	  _M_destroy_pback();
 	  
 	  if (!_M_file.close())
 	    __testfail = true;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]