浏览代码

minor vfs tweaks

David Rose 17 年之前
父节点
当前提交
a0220f786c
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 5 2
      dtool/src/prc/streamReader.cxx
  2. 1 0
      panda/src/express/virtualFileSimple.h

+ 5 - 2
dtool/src/prc/streamReader.cxx

@@ -115,11 +115,14 @@ skip_bytes(size_t size) {
 //     Function: StreamReader::extract_bytes
 //       Access: Published
 //  Description: Extracts the indicated number of bytes in the
-//               stream and returns them as a string.
+//               stream and returns them as a string.  Returns empty
+//               string at end-of-file.
 ////////////////////////////////////////////////////////////////////
 string StreamReader::
 extract_bytes(size_t size) {
-  nassertr(!_in->eof() && !_in->fail(), string());
+  if (_in->eof() || _in->fail()) {
+    return string();
+  }
 
   char *buffer = (char *)alloca(size);
   _in->read(buffer, size);

+ 1 - 0
panda/src/express/virtualFileSimple.h

@@ -32,6 +32,7 @@ public:
                            const Filename &local_filename,
                            bool implicit_pz_file);
 
+PUBLISHED:
   virtual VirtualFileSystem *get_file_system() const;
   INLINE VirtualFileMount *get_mount() const;
   virtual Filename get_filename() const;