ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/io/basic_ifstrstream.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-2.0/src/io/basic_ifstrstream.hpp (file contents):
Revision 1890 by tim, Mon Dec 13 22:30:27 2004 UTC vs.
Revision 1891 by tim, Wed Dec 15 22:34:41 2004 UTC

# Line 324 | Line 324 | class basic_ifstrstream : public std::basic_istream<_C
324              //in single version, fall back to ifstream
325              std::basic_filebuf<_CharT, _Traits>* fileBuffer = new  std::basic_filebuf<_CharT, _Traits>();
326  
327 <            this->init(fileBuffer);
328 <            if (!fileBuffer->open(filename, mode))
327 >            //it is safe to delete null pointer
328 >            delete internalBuf_;
329 >            internalBuf_ =  fileBuffer;
330 >
331 >            this->init(internalBuf_);
332 >            if (!fileBuffer->open(filename, mode)) {
333                  this->setstate(ios_base::failbit);
334 +                return false;
335 +            }    
336  
331            //it is safe to delete null pointer
332            delete internalBuf_;
333
334           internalBuf_ =  fileBuffer;
337   #endif
338  
339              return true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines