fd9cba7
diff -Naur zipios++-0.1.5.9+cvs.2007.04.28.orig/src/zipinputstreambuf.cpp zipios++-0.1.5.9+cvs.2007.04.28/src/zipinputstreambuf.cpp
fd9cba7
--- zipios++-0.1.5.9+cvs.2007.04.28.orig/src/zipinputstreambuf.cpp	2007-01-28 18:08:47.000000000 -0600
fd9cba7
+++ zipios++-0.1.5.9+cvs.2007.04.28/src/zipinputstreambuf.cpp	2012-06-27 10:21:24.767156783 -0500
fd9cba7
@@ -18,7 +18,13 @@
fd9cba7
 ZipInputStreambuf::ZipInputStreambuf( streambuf *inbuf, int s_pos, bool del_inbuf ) 
fd9cba7
   : InflateInputStreambuf( inbuf, s_pos, del_inbuf ),
fd9cba7
     _open_entry( false                   ) 
fd9cba7
-{}
fd9cba7
+{
fd9cba7
+  ConstEntryPointer entry = getNextEntry() ;
fd9cba7
+  
fd9cba7
+  if ( ! entry->isValid() ) {
fd9cba7
+    ; // FIXME: throw something?
fd9cba7
+  }
fd9cba7
+}
fd9cba7
 
fd9cba7
 void ZipInputStreambuf::closeEntry() {
fd9cba7
   if ( ! _open_entry )
fd9cba7
@@ -42,30 +48,28 @@
fd9cba7
 
fd9cba7
   // read the zip local header
fd9cba7
   istream is( _inbuf ) ; // istream does not destroy the streambuf.
fd9cba7
-  is.exceptions( ios::eofbit | ios::failbit | ios::badbit );
fd9cba7
-
fd9cba7
-  try {
fd9cba7
-    is >> _curr_entry ;
fd9cba7
-    if ( _curr_entry.isValid() ) {
fd9cba7
-      _data_start = _inbuf->pubseekoff(0, ios::cur, ios::in);
fd9cba7
-      if ( _curr_entry.getMethod() == DEFLATED ) {
fd9cba7
-        _open_entry = true ;
fd9cba7
-        reset() ; // reset inflatestream data structures 
fd9cba7
-        // cerr << "deflated" << endl ;
fd9cba7
-      } else if ( _curr_entry.getMethod() == STORED ) {
fd9cba7
-        _open_entry = true ;
fd9cba7
-        _remain = _curr_entry.getSize() ;
fd9cba7
-        // Force underflow on first read:
fd9cba7
-        setg( &( _outvec[ 0 ] ),
fd9cba7
-              &( _outvec[ 0 ] ) + _outvecsize,
fd9cba7
-              &( _outvec[ 0 ] ) + _outvecsize );
fd9cba7
-        // cerr << "stored" << endl ;
fd9cba7
-      } else {
fd9cba7
-        _open_entry = false ; // Unsupported compression format.
fd9cba7
-        throw FCollException( "Unsupported compression format" ) ;
fd9cba7
-      }
fd9cba7
+  is.exceptions(istream::eofbit | istream::failbit | istream::badbit);
fd9cba7
+  is >> _curr_entry ;
fd9cba7
+  if ( _curr_entry.isValid() ) {
fd9cba7
+    _data_start = _inbuf->pubseekoff(0, ios::cur, 
fd9cba7
+				     ios::in);
fd9cba7
+    if ( _curr_entry.getMethod() == DEFLATED ) {
fd9cba7
+      _open_entry = true ;
fd9cba7
+      reset() ; // reset inflatestream data structures 
fd9cba7
+//        cerr << "deflated" << endl ;
fd9cba7
+    } else if ( _curr_entry.getMethod() == STORED ) {
fd9cba7
+      _open_entry = true ;
fd9cba7
+      _remain = _curr_entry.getSize() ;
fd9cba7
+      // Force underflow on first read:
fd9cba7
+      setg( &( _outvec[ 0 ] ),
fd9cba7
+	    &( _outvec[ 0 ] ) + _outvecsize,
fd9cba7
+	    &( _outvec[ 0 ] ) + _outvecsize ) ;
fd9cba7
+//        cerr << "stored" << endl ;
fd9cba7
+    } else {
fd9cba7
+      _open_entry = false ; // Unsupported compression format.
fd9cba7
+      throw FCollException( "Unsupported compression format" ) ;
fd9cba7
     }
fd9cba7
-  } catch (...) {
fd9cba7
+  } else {
fd9cba7
     _open_entry = false ;
fd9cba7
   }
fd9cba7
 
fd9cba7
@@ -119,7 +123,7 @@
fd9cba7
 
fd9cba7
 /*
fd9cba7
   Zipios++ - a small C++ library that provides easy access to .zip files.
fd9cba7
-  Copyright (C) 2000  Thomas Søndergaard
fd9cba7
+  Copyright (C) 2000  Thomas Søndergaard
fd9cba7
   
fd9cba7
   This library is free software; you can redistribute it and/or
fd9cba7
   modify it under the terms of the GNU Lesser General Public