projects
/
physics.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b26d04a
)
fix config reader bug
author
Patrik Gornicz
<Gornicz.P@gmail.com>
Fri, 29 Aug 2008 03:04:00 +0000
(23:04 -0400)
committer
Patrik Gornicz
<Gornicz.P@gmail.com>
Fri, 29 Aug 2008 03:04:00 +0000
(23:04 -0400)
src/config/reader.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/config/reader.cpp
b/src/config/reader.cpp
index
19f7d33
..
beb6e20
100644
(file)
--- a/
src/config/reader.cpp
+++ b/
src/config/reader.cpp
@@
-36,6
+36,7
@@
bool extractLine(const string& str, string* name, string* value);
/// ***** Private Variables *****
char* configDir = "configs/";
/// ***** Private Variables *****
char* configDir = "configs/";
+char* testFile = "test.cfg";
/// ***** Public Methods *****
/// ***** Public Methods *****
@@
-44,7
+45,7
@@
void readConfigs(inputMap* map)
char fileName[64];
strcpy(fileName, configDir);
char fileName[64];
strcpy(fileName, configDir);
- strcat(fileName,
"test.cfg"
);
+ strcat(fileName,
testFile
);
ifstream file(fileName);
ifstream file(fileName);
@@
-141,14
+142,17
@@
bool extractLine(const string& str, string* name, string* value)
char_pos--; // decrement to stay on this char
break;
case 2:
char_pos--; // decrement to stay on this char
break;
case 2:
- if(c_str[char_pos] == '=')
- state++;
-
if(c_str[char_pos] != ' '
if(c_str[char_pos] != ' '
- && c_str[char_pos] != '\t')
+ && c_str[char_pos] != '\t'
+ && c_str[char_pos] != '=')
{
return false;
}
{
return false;
}
+
+ if(c_str[char_pos] == '=')
+ {
+ state++;
+ }
break;
case 3:
if(c_str[char_pos] != ' '
break;
case 3:
if(c_str[char_pos] != ' '