summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-01-31 21:00:00 (GMT)
committerMarius Kintel <marius@kintel.net>2012-01-31 21:00:00 (GMT)
commit5056de8d1ce8bd6247604ff6523cc4894ec7de4e (patch)
treeae21fd26005474aaac4232d3cd6bc7df34d349fb
parenta15c89922e347f6b92e7ddc20e6d5fcd35b207ce (diff)
bugfix: scad files without a newline as the last character could leave a commented out line open, shadowing command-line parameters. Fixes #76
-rw-r--r--src/openscad.cc2
-rw-r--r--tests/tests-common.cc2
2 files changed, 2 insertions, 2 deletions
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;
contact: Jan Huwald // Impressum