summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-10 02:26:34 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-10 02:26:34 -0500
commit329a0dfcc53354be7873385383ca6d8238e5a97e (patch)
tree74035601b6777f5e46547d22572b73094958ab80 /src
parentbf24b93818989bc10afb10554b236c16c47298c1 (diff)
downloadfork-ledger-329a0dfcc53354be7873385383ca6d8238e5a97e.tar.gz
fork-ledger-329a0dfcc53354be7873385383ca6d8238e5a97e.tar.bz2
fork-ledger-329a0dfcc53354be7873385383ca6d8238e5a97e.zip
Corrected the parsing of data file directives
Diffstat (limited to 'src')
-rw-r--r--src/textual.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/textual.cc b/src/textual.cc
index c3a44be6..5a9e2165 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -703,60 +703,66 @@ void instance_t::define_directive(char * line)
bool instance_t::general_directive(char * line)
{
- char * p = line;
+ char buf[8192];
+
+ std::strcpy(buf, line);
+
+ char * p = buf;
+ char * arg = next_element(buf);
+
if (*p == '@' || *p == '!')
p++;
switch (*p) {
case 'a':
if (std::strcmp(p, "account") == 0) {
- master_account_directive(next_element(line));
+ master_account_directive(arg);
return true;
}
else if (std::strcmp(p, "alias") == 0) {
- alias_directive(next_element(line));
+ alias_directive(arg);
return true;
}
break;
case 'b':
if (std::strcmp(p, "bucket") == 0) {
- default_account_directive(next_element(line));
+ default_account_directive(arg);
return true;
}
break;
case 'd':
if (std::strcmp(p, "def") == 0 || std::strcmp(p, "define") == 0) {
- define_directive(next_element(line));
+ define_directive(arg);
return true;
}
break;
case 'e':
if (std::strcmp(p, "end") == 0) {
- end_directive(next_element(line));
+ end_directive(arg);
return true;
}
break;
case 'i':
if (std::strcmp(p, "include") == 0) {
- include_directive(next_element(line));
+ include_directive(arg);
return true;
}
break;
case 'p':
if (std::strcmp(p, "pop") == 0) {
- pop_directive(next_element(line));
+ pop_directive(arg);
return true;
}
break;
case 't':
if (std::strcmp(p, "tag") == 0) {
- tag_directive(next_element(line));
+ tag_directive(arg);
return true;
}
break;