diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-11-30 19:24:40 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-11-30 19:24:40 +0000 |
commit | 0ff3fdfaa52ee4b71632f201d6bfabb0ffbc36d7 (patch) | |
tree | 14951a51950dffbe094b6cdd3fd56d239b1079f2 /src/tafreader.cpp | |
parent | 4d0a7466320e54f45f413efef09ef8e6ad21bb3e (diff) | |
download | libbu++-0ff3fdfaa52ee4b71632f201d6bfabb0ffbc36d7.tar.gz libbu++-0ff3fdfaa52ee4b71632f201d6bfabb0ffbc36d7.tar.bz2 libbu++-0ff3fdfaa52ee4b71632f201d6bfabb0ffbc36d7.tar.xz libbu++-0ff3fdfaa52ee4b71632f201d6bfabb0ffbc36d7.zip |
Fixed the overshoot in the Bu::TafReader, it was reading the lookahead character
from the stream even when it should have known it was at the end, and then it
was reading an extra character after that anyway :-P It is now fixed, and the
stream is positioned at the character immediately after the closing } of the
root taf group, great for things like the svtools.
Diffstat (limited to 'src/tafreader.cpp')
-rw-r--r-- | src/tafreader.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/tafreader.cpp b/src/tafreader.cpp index aaac8d7..7054581 100644 --- a/src/tafreader.cpp +++ b/src/tafreader.cpp | |||
@@ -40,7 +40,7 @@ Bu::TafGroup *Bu::TafReader::readGroup() | |||
40 | if( c != '}' ) | 40 | if( c != '}' ) |
41 | throw TafException("Expected '}'"); | 41 | throw TafException("Expected '}'"); |
42 | 42 | ||
43 | next(); | 43 | //next(); |
44 | 44 | ||
45 | return pGroup; | 45 | return pGroup; |
46 | } | 46 | } |
@@ -184,7 +184,17 @@ bool Bu::TafReader::isws() | |||
184 | 184 | ||
185 | void Bu::TafReader::next() | 185 | void Bu::TafReader::next() |
186 | { | 186 | { |
187 | c = la; | 187 | if( c == '}' ) |
188 | sIn.read( &la, 1 ); | 188 | { |
189 | sIn.read( &c, 1 ); | ||
190 | if( c != '}' ) | ||
191 | sIn.read( &la, 1 ); | ||
192 | } | ||
193 | else | ||
194 | { | ||
195 | c = la; | ||
196 | if( c != '}' ) | ||
197 | sIn.read( &la, 1 ); | ||
198 | } | ||
189 | } | 199 | } |
190 | 200 | ||