summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0493ba1)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16856
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxInputStream& wxInputStream::Read(void *buf, size_t size)
{
wxInputStream& wxInputStream::Read(void *buf, size_t size)
{
- size_t retsize = GetWBack(buf, size);
- if (retsize == size)
+ char *p = (char *)buf;
+ m_lastcount = 0;
+
+ size_t read = GetWBack(buf, size);
+ for ( ;; )
- m_lastcount = size;
- m_lasterror = wxStream_NOERROR;
- return *this;
+ size -= read;
+ m_lastcount += read;
+ p += read;
+
+ if ( !size )
+ {
+ // we read the requested amount of data
+ break;
+ }
+
+ read = OnSysRead(buf, size);
+ if ( !read )
+ {
+ // no more data available
+ break;
+ }
- size -= retsize;
- buf = (char *)buf + retsize;
- m_lastcount = OnSysRead(buf, size) + retsize;