* [#14812](http://bugzilla.scilab.org/show_bug.cgi?id=14812): Minor typos in messages.
* [#14863](http://bugzilla.scilab.org/show_bug.cgi?id=14863): In Xcos, the default ending time was unhandily high (100000), reduced it to 30.
* [#14982](http://bugzilla.scilab.org/show_bug.cgi?id=14982): `msprintf` segmentation fault was caught due to wrong size
+* [#14985](http://bugzilla.scilab.org/show_bug.cgi?id=14985): scilab crashed if a .bin file was not found.
* [#15087](http://bugzilla.scilab.org/show_bug.cgi?id=15087): Deleting rows or columns from a matrix is slow (regression)
* [#15269](http://bugzilla.scilab.org/show_bug.cgi?id=15269): `xgetech` was poor and stiff compared to any combination of `gca()` properties `.axes_bounds`, `.data_bounds`, `.log_flags`, and `.margins`. It is removed.
* [#15271](http://bugzilla.scilab.org/show_bug.cgi?id=15271): `bitget` needed to be upgraded.
{
if (m_pMacro == NULL)
{
- //load file, only for the first call
char* pstPath = wide_string_to_UTF8(m_stPath.c_str());
+ //load file, only for the first call
+#ifdef _MSC_VER
+ std::ifstream f(m_stPath.c_str(), std::ios::in | std::ios::binary | std::ios::ate);
+#else
std::ifstream f(pstPath, std::ios::in | std::ios::binary | std::ios::ate);
+#endif
+
if (f.is_open() == false)
{
- Scierror(999, _("Unable to open : %s.\n"), pstPath);
+ char errorMsg[bsiz];
+ snprintf(errorMsg, bsiz, _("Unable to open : %s.\n"), pstPath);
FREE(pstPath);
- return false;
+ throw ast::InternalError(errorMsg);
}
- FREE(pstPath);
+ FREE(pstPath);
int size = (int)f.tellg();
unsigned char* binAst = new unsigned char[size];
f.seekg(0);
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - ESI Group - Antoine ELIAS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+// <-- NO CHECK REF -->
+//
+// <-- Non-regression test for bug 14985 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/14985
+//
+// <-- Short Description -->
+// scilab crashes if a .bin file was not found
+
+//if file is deleted
+cd TMPDIR;
+mkdir buglib;
+mputl(["function test(a,b)";"disp([a,b])";"endfunction"],"buglib/test.sci");
+genlib("blib","buglib");
+blib=lib("buglib");
+test(1,2) //ok
+deletefile("buglib/test.bin");
+clear;
+blib=lib("buglib");
+
+msg = msprintf(_("Unable to open : %s.\n"), fullfile(TMPDIR, "buglib", "test.bin"));
+assert_checkerror("test(1, 2)", msg); //avoid crash
+
+//or if the file is not reachable ( trouble with éàè in path of .bin files )
+clear;
+path = "boite à outils";
+cd TMPDIR;
+mkdir(path);
+mputl(["function test(a,b)";"disp([a,b])";"endfunction"], fullfile(path, "test.sci"));
+genlib("blib", path);
+blib=lib(path);
+test(1,2) //ok