diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-10 02:26:34 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-10 02:26:34 -0500 |
commit | 329a0dfcc53354be7873385383ca6d8238e5a97e (patch) | |
tree | 74035601b6777f5e46547d22572b73094958ab80 /src | |
parent | bf24b93818989bc10afb10554b236c16c47298c1 (diff) | |
download | fork-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.cc | 24 |
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; |