From 45abdd4c47ace6b3c6d72791953646e46e687130 Mon Sep 17 00:00:00 2001 From: darkeye Date: Sun, 9 Sep 2001 11:26:43 +0000 Subject: [PATCH] full line comments skipped earlier: commens allowed before the first secion --- darkice/trunk/src/Config.cpp | 6 ++++++ darkice/trunk/src/ConfigSection.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/darkice/trunk/src/Config.cpp b/darkice/trunk/src/Config.cpp index a5fa781..32351bb 100644 --- a/darkice/trunk/src/Config.cpp +++ b/darkice/trunk/src/Config.cpp @@ -107,6 +107,9 @@ Config :: addLine ( const char * line ) throw ( Exception ) str.erase( ix + 1); } + if ( !str.length() ) { + return true; + } if ( str[0] == '[' && str[str.size()-1] == ']' ) { // a new section starts @@ -161,6 +164,9 @@ Config :: read ( istream & is ) throw ( Exception ) $Source$ $Log$ + Revision 1.5 2001/09/09 11:26:43 darkeye + full line comments skipped earlier: commens allowed before the first secion + Revision 1.4 2001/09/05 20:11:15 darkeye removed dependency on locally stored SGI STL header files now compiler-supplied C++ library STL header files are used diff --git a/darkice/trunk/src/ConfigSection.cpp b/darkice/trunk/src/ConfigSection.cpp index 735acba..5290952 100644 --- a/darkice/trunk/src/ConfigSection.cpp +++ b/darkice/trunk/src/ConfigSection.cpp @@ -140,6 +140,9 @@ ConfigSection :: addLine ( const char * line ) throw ( Exception ) if ( (ix = str.find_last_not_of( ' ')) != str.npos ) { str.erase( ix + 1); } + if ( !str.length() ) { + return true; + } /* find the '=' delimiter between key and value */ if ( (ix = str.find( '=')) == str.npos ) { @@ -168,6 +171,9 @@ ConfigSection :: addLine ( const char * line ) throw ( Exception ) $Source$ $Log$ + Revision 1.6 2001/09/09 11:26:43 darkeye + full line comments skipped earlier: commens allowed before the first secion + Revision 1.5 2001/09/05 20:11:15 darkeye removed dependency on locally stored SGI STL header files now compiler-supplied C++ library STL header files are used