From 5056de8d1ce8bd6247604ff6523cc4894ec7de4e Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 31 Jan 2012 22:00:00 +0100 Subject: bugfix: scad files without a newline as the last character could leave a commented out line open, shadowing command-line parameters. Fixes #76 diff --git a/src/openscad.cc b/src/openscad.cc index c687372..980e2af 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -273,7 +273,7 @@ int main(int argc, char **argv) text << buffer; } fclose(fp); - text << commandline_commands; + text << "\n" << commandline_commands; fs::path abspath = boosty::absolute( filename ); std::string fname = boosty::stringy( abspath ); root_module = parse(text.str().c_str(), fname.c_str(), false); diff --git a/tests/tests-common.cc b/tests/tests-common.cc index 1f19c59..1694a74 100644 --- a/tests/tests-common.cc +++ b/tests/tests-common.cc @@ -25,7 +25,7 @@ AbstractModule *parsefile(const char *filename) text << buffer; } fclose(fp); - text << commandline_commands; + text << "\n" << commandline_commands; root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); } return root_module; -- cgit v0.10.1