aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-11-09 22:11:03 +0000
committerMike Buland <eichlan@xagasoft.com>2007-11-09 22:11:03 +0000
commitbb9c0dc8dd2c852d9b6e89b9fd883232019cea93 (patch)
tree8ce5fce962ce91a96a60a80a2214ca4d4d808f4c
parent414328563a8c3972e8d053fb770741eb0123d826 (diff)
downloadlibbu++-bb9c0dc8dd2c852d9b6e89b9fd883232019cea93.tar.gz
libbu++-bb9c0dc8dd2c852d9b6e89b9fd883232019cea93.tar.bz2
libbu++-bb9c0dc8dd2c852d9b6e89b9fd883232019cea93.tar.xz
libbu++-bb9c0dc8dd2c852d9b6e89b9fd883232019cea93.zip
Fixed a silly bug in the taf system that interpreted the */ at the end of a
comment block as a tag...oops.
Diffstat (limited to '')
-rw-r--r--src/tafreader.cpp3
-rw-r--r--src/tests/taf.cpp42
2 files changed, 31 insertions, 14 deletions
diff --git a/src/tafreader.cpp b/src/tafreader.cpp
index 6441ac3..5609f7c 100644
--- a/src/tafreader.cpp
+++ b/src/tafreader.cpp
@@ -79,7 +79,10 @@ Bu::TafComment *Bu::TafReader::readComment()
79 { 79 {
80 next(); 80 next();
81 if( c == '*' && la == '/' ) 81 if( c == '*' && la == '/' )
82 {
83 next(); next();
82 break; 84 break;
85 }
83 sCmnt += c; 86 sCmnt += c;
84 } 87 }
85 88
diff --git a/src/tests/taf.cpp b/src/tests/taf.cpp
index cb9b75f..d832c9b 100644
--- a/src/tests/taf.cpp
+++ b/src/tests/taf.cpp
@@ -2,23 +2,37 @@
2#include "bu/tafwriter.h" 2#include "bu/tafwriter.h"
3#include "bu/file.h" 3#include "bu/file.h"
4 4
5int main() 5int main( int argc, char *argv[] )
6{ 6{
7 Bu::File f("test.taf", "rb"); 7 if( argc == 1 )
8 Bu::TafReader tr( f ); 8 {
9 Bu::File f("test.taf", "rb");
10 Bu::TafReader tr( f );
11
12 Bu::TafGroup *pGroup = tr.readGroup();
13
14 {
15 Bu::File fo("out.taf", "wb");
16 Bu::TafWriter tw( fo );
17 tw.writeGroup( pGroup );
18 }
9 19
10 Bu::TafGroup *pGroup = tr.readGroup(); 20 delete pGroup;
11/* 21 }
12 const Bu::TafGroup *pStats = pGroup->getChild("stats"); 22 else if( argc == 3 )
13 printf("%s\n", pStats->getName().getStr() );
14 printf(" str = %s\n", pStats->getProperty("str").getStr() );*/
15/*
16 { 23 {
17 Bu::File fo("out.taf", "wb"); 24 Bu::File f( argv[1], "rb");
18 Bu::TafWriter tw( fo ); 25 Bu::TafReader tr( f );
19 tw.writeGroup( pGroup ); 26
20 }*/ 27 Bu::TafGroup *pGroup = tr.readGroup();
28
29 {
30 Bu::File fo( argv[2], "wb");
31 Bu::TafWriter tw( fo );
32 tw.writeGroup( pGroup );
33 }
21 34
22 delete pGroup; 35 delete pGroup;
36 }
23} 37}
24 38