From ecedf7a7d87553116c570ba789b6405ac5eff92d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 26 Aug 2007 04:12:51 +0000 Subject: Corrected a bug in the Bu::TafReader, it was getting confused when a stray colon (common in web addresses) was put in the middle of a property list, now it doesn't get confused, it just complains bitterly and refuses to work. --- src/tafreader.cpp | 2 ++ src/tests/taf.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/tafreader.cpp b/src/tafreader.cpp index db465e9..0d28cd0 100644 --- a/src/tafreader.cpp +++ b/src/tafreader.cpp @@ -49,6 +49,8 @@ void Bu::TafReader::groupContent( Bu::TafGroup *pGroup ) return; else if( c == '/' && la == '*' ) pGroup->addChild( readComment() ); + else if( c == ':' ) + throw TafException("Encountered stray ':' in taf stream."); else pGroup->addChild( readProperty() ); } diff --git a/src/tests/taf.cpp b/src/tests/taf.cpp index e3da120..cb9b75f 100644 --- a/src/tests/taf.cpp +++ b/src/tests/taf.cpp @@ -8,16 +8,16 @@ int main() Bu::TafReader tr( f ); Bu::TafGroup *pGroup = tr.readGroup(); - +/* const Bu::TafGroup *pStats = pGroup->getChild("stats"); printf("%s\n", pStats->getName().getStr() ); - printf(" str = %s\n", pStats->getProperty("str").getStr() ); - + printf(" str = %s\n", pStats->getProperty("str").getStr() );*/ +/* { Bu::File fo("out.taf", "wb"); Bu::TafWriter tw( fo ); tw.writeGroup( pGroup ); - } + }*/ delete pGroup; } -- cgit v1.2.3