diff options
author | Marius Kintel <marius@kintel.net> | 2012-10-24 01:48:29 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-10-24 01:48:29 (GMT) |
commit | 5467bc94116c7e3f22210ace64e0678fff4d4347 (patch) | |
tree | 77e21bc330fb7e358245f4588942ec4a31110007 /src/ModuleCache.cc | |
parent | b7cc740b78ea636868c560871437b3beed45cf2e (diff) |
Make cmd-line overrides using -D work also for USEd modules. Fixes #211
Diffstat (limited to 'src/ModuleCache.cc')
-rw-r--r-- | src/ModuleCache.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ModuleCache.cc b/src/ModuleCache.cc index c215342..19a3f84 100644 --- a/src/ModuleCache.cc +++ b/src/ModuleCache.cc @@ -72,7 +72,9 @@ Module *ModuleCache::evaluate(const std::string &filename) PRINTB("WARNING: Can't open library file '%s'\n", filename); return NULL; } - std::string text((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()); + std::stringstream textbuf; + textbuf << ifs.rdbuf(); + textbuf << "\n" << commandline_commands; print_messages_push(); @@ -84,7 +86,7 @@ Module *ModuleCache::evaluate(const std::string &filename) this->entries[filename] = e; std::string pathname = boosty::stringy(fs::path(filename).parent_path()); - lib_mod = dynamic_cast<Module*>(parse(text.c_str(), pathname.c_str(), false)); + lib_mod = dynamic_cast<Module*>(parse(textbuf.str().c_str(), pathname.c_str(), false)); PRINTB_NOCACHE(" compiled module: %p", lib_mod); if (lib_mod) { |