diff --git a/scripts/release-common.sh b/scripts/release-common.sh index 2da42495..2c98a625 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -255,7 +255,7 @@ case $OS in exit fi # make console pipe-able openscad.com - see winconsole.pro for info - qmake ../winconsole.pro + qmake ../winconsole/winconsole.pro make if [ ! -e $TARGET/openscad.com ]; then echo "cant find $TARGET/openscad.com. build failed. stopping." diff --git a/src/fileutils.cc b/src/fileutils.cc index ac3144ea..621bb600 100644 --- a/src/fileutils.cc +++ b/src/fileutils.cc @@ -22,7 +22,7 @@ std::string lookup_file(const std::string &filename, if (!fs::exists(absfile) && fs::exists(absfile_fallback)) { resultfile = absfile_fallback.string(); - PRINT_DEPRECATION("DEPRECATED: Imported file (%s) found in document root instead of relative to the importing module. This behavior is deprecated", filename); + PRINT_DEPRECATION("Imported file (%s) found in document root instead of relative to the importing module. This behavior is deprecated", filename); } else { resultfile = absfile.string(); diff --git a/src/func.cc b/src/func.cc index 75597720..8fc10da2 100644 --- a/src/func.cc +++ b/src/func.cc @@ -712,7 +712,7 @@ ValuePtr builtin_lookup(const Context *, const EvalContext *evalctx) */ static Value::VectorType search(const std::string &find, const std::string &table, - unsigned int num_returns_per_match, unsigned int index_col_num) + unsigned int num_returns_per_match) { Value::VectorType returnvec; //Unicode glyph count for the length @@ -761,7 +761,12 @@ static Value::VectorType search(const std::string &find, const Value::VectorType Value::VectorType resultvec; const gchar *ptr_ft = g_utf8_offset_to_pointer(find.c_str(), i); for (size_t j = 0; j < searchTableSize; j++) { - const gchar *ptr_st = g_utf8_offset_to_pointer(table[j].toVector()[index_col_num].toString().c_str(), 0); + Value::VectorType entryVec = table[j].toVector(); + if (entryVec.size() <= index_col_num) { + PRINTB("WARNING: Invalid entry in search vector at index %d, required number of values in the entry: %d. Invalid entry: %s", j % (index_col_num + 1) % table[j]); + return Value::VectorType(); + } + const gchar *ptr_st = g_utf8_offset_to_pointer(entryVec[index_col_num].toString().c_str(), 0); if (ptr_ft && ptr_st && (g_utf8_get_char(ptr_ft) == g_utf8_get_char(ptr_st)) ) { matchCount++; if (num_returns_per_match == 1) { @@ -814,7 +819,7 @@ ValuePtr builtin_search(const Context *, const EvalContext *evalctx) } } else if (findThis->type() == Value::STRING) { if (searchTable->type() == Value::STRING) { - returnvec = search(findThis->toString(), searchTable->toString(), num_returns_per_match, index_col_num); + returnvec = search(findThis->toString(), searchTable->toString(), num_returns_per_match); } else { returnvec = search(findThis->toString(), searchTable->toVector(), num_returns_per_match, index_col_num); diff --git a/src/modcontext.cc b/src/modcontext.cc index 04d46e60..90f04700 100644 --- a/src/modcontext.cc +++ b/src/modcontext.cc @@ -116,7 +116,7 @@ const AbstractModule *ModuleContext::findLocalModule(const std::string &name) co } std::string replacement = Builtins::instance()->isDeprecated(name); if (!replacement.empty()) { - PRINT_DEPRECATION("DEPRECATED: The %s() module will be removed in future releases. Use %s instead.", name % replacement); + PRINT_DEPRECATION("The %s() module will be removed in future releases. Use %s instead.", name % replacement); } return m; } diff --git a/testdata/scad/bugs/issue1105d.scad b/testdata/scad/bugs/issue1105d.scad new file mode 100644 index 00000000..f37b6554 --- /dev/null +++ b/testdata/scad/bugs/issue1105d.scad @@ -0,0 +1,8 @@ +difference() { + rotate_extrude(convexity=2, $fn=8) + translate([5,0,0]) difference() { + circle(r=2); + circle(r=1); + } + translate([-5,-5,5]) cube(10, center=true); +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 19bdaaff..76f21166 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1221,7 +1221,8 @@ list(APPEND BUGS_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue584.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue945d.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105b.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105c.scad) + ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105c.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105d.scad) list(APPEND EXPORT3D_TEST_FILES ${BUGS_FILES}) list(REMOVE_ITEM EXPORT3D_TEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue899.scad diff --git a/tests/regression/cgalpngtest/issue1105d-expected.png b/tests/regression/cgalpngtest/issue1105d-expected.png new file mode 100644 index 00000000..b62fcca2 Binary files /dev/null and b/tests/regression/cgalpngtest/issue1105d-expected.png differ diff --git a/tests/regression/monotonepngtest/issue1105d-expected.png b/tests/regression/monotonepngtest/issue1105d-expected.png new file mode 100644 index 00000000..b5c4e5e3 Binary files /dev/null and b/tests/regression/monotonepngtest/issue1105d-expected.png differ diff --git a/tests/regression/opencsgtest/issue1105d-expected.png b/tests/regression/opencsgtest/issue1105d-expected.png new file mode 100644 index 00000000..e6d2c817 Binary files /dev/null and b/tests/regression/opencsgtest/issue1105d-expected.png differ diff --git a/src/winconsole.c b/winconsole/winconsole.c similarity index 100% rename from src/winconsole.c rename to winconsole/winconsole.c diff --git a/winconsole.pro b/winconsole/winconsole.pro similarity index 83% rename from winconsole.pro rename to winconsole/winconsole.pro index 11078f36..8b423a6a 100644 --- a/winconsole.pro +++ b/winconsole/winconsole.pro @@ -11,13 +11,13 @@ # properly TEMPLATE = app -TARGET = openscad_winconsole +TARGET = winconsole FORMS = HEADERS = FLEXSOURCES = BISONSOURCES = RESOURCES = -SOURCES = src/winconsole.c +SOURCES = winconsole.c CONFIG -= qt CONFIG += console # sets IMAGE_SUBSYSTEM_WINDOWS_CUI in binary -QMAKE_POST_LINK = cd $(DESTDIR) && mv openscad_winconsole.exe openscad.com +QMAKE_POST_LINK = cd $(DESTDIR) && mv winconsole.exe openscad.com