diff options
-rw-r--r-- | doc/TODO.txt | 1 | ||||
-rw-r--r-- | src/ModuleCache.cc | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/doc/TODO.txt b/doc/TODO.txt index 7f8378d..c58a942 100644 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -239,6 +239,7 @@ o Collect "all" available OpenSCAD scripts from the internets and run the integr MISSING TESTS: -------------- +o cmd-line -D variable override o all functions o mirror o scale 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) { |