summaryrefslogtreecommitdiff
path: root/Config.cpp
diff options
context:
space:
mode:
authorKris Parker2009-10-30 18:11:10 +0000
committerKris Parker2009-10-30 18:11:10 +0000
commit4fb5db10df0a99475433865b3ee2b88303a1d9c5 (patch)
treea67a934a1236bfa0ef340083e501c6c9217bde52 /Config.cpp
parentf64930129308105f8b60a4a90c9a4a40df75ef6d (diff)
downloadstonesense-4fb5db10df0a99475433865b3ee2b88303a1d9c5.tar.gz
stonesense-4fb5db10df0a99475433865b3ee2b88303a1d9c5.tar.bz2
stonesense-4fb5db10df0a99475433865b3ee2b88303a1d9c5.tar.xz
Some foolproofing for init.txt files
Diffstat (limited to 'Config.cpp')
-rw-r--r--Config.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Config.cpp b/Config.cpp
index 3bddefb..cdf3254 100644
--- a/Config.cpp
+++ b/Config.cpp
@@ -45,6 +45,11 @@ int parseIntFromLine( string keyword, string line ){
void parseConfigLine( string line ){
char c = line[0];
if( c != '[') return;
+
+ //some systems don't remove the \r char as a part of the line change:
+ if(line.size() > 0 && line[line.size() -1 ] == '\r' )
+ line.resize(line.size() -1);
+
c = line[ line.length() -1 ];
if( c != ']' ) return;
@@ -103,7 +108,10 @@ bool loadConfigFile(){
string line;
ifstream myfile ("init.txt");
if (myfile.is_open() == false)
+ {
+ cout << "Cannot find init file" << endl;
return false;
+ }
while ( !myfile.eof() )
{