diff options
author | John Wiegley <johnw@newartisans.com> | 2006-02-15 20:46:07 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:22 -0400 |
commit | 110a23d2f06565204e509b60b0bc28d5ef61a2ae (patch) | |
tree | 32f573f2079cc5198e412afafc9cda45ca0bd601 /ofx.cc | |
parent | 27273bb2f46a964ef3262c99e503aab005fe59d1 (diff) | |
download | fork-ledger-110a23d2f06565204e509b60b0bc28d5ef61a2ae.tar.gz fork-ledger-110a23d2f06565204e509b60b0bc28d5ef61a2ae.tar.bz2 fork-ledger-110a23d2f06565204e509b60b0bc28d5ef61a2ae.zip |
Added in.clear() before resetting I/Os streams. Again, thanks to the
list.
Diffstat (limited to 'ofx.cc')
-rw-r--r-- | ofx.cc | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -172,10 +172,12 @@ bool ofx_parser_t::test(std::istream& in) const in.getline(buf, 79); if (std::strncmp(buf, "OFXHEADER", 9) == 0) { + in.clear(); in.seekg(0, std::ios::beg); return true; } else if (std::strncmp(buf, "<?xml", 5) != 0) { + in.clear(); in.seekg(0, std::ios::beg); return false; } @@ -183,10 +185,12 @@ bool ofx_parser_t::test(std::istream& in) const in.getline(buf, 79); if (std::strncmp(buf, "<?OFX", 5) != 0 && std::strncmp(buf, "<?ofx", 5) != 0) { + in.clear(); in.seekg(0, std::ios::beg); return false; } + in.clear(); in.seekg(0, std::ios::beg); return true; } |