From: Samuel GOUGEON Date: Thu, 22 Apr 2021 17:41:08 +0000 (+0200) Subject: * Bug 16679 fixed: get_function_path('acosh') yielded an error X-Git-Tag: 6.1.1~62 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=5c4416e8a5bd73bad63e902d09646b768305988d * Bug 16679 fixed: get_function_path('acosh') yielded an error http://bugzilla.scilab.org/16679 Change-Id: Ife5e2e8bffbe19a406112171ce73ea2639a1114f --- diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index 5a4f552..29267ec 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -463,6 +463,7 @@ Bug Fixes * [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory. * [#16661](https://bugzilla.scilab.org/16661): `x=spzeros(1e10,1e10)` yielded an incorrect error message. * [#16665](https://bugzilla.scilab.org/16665): `help echo` could not redirect to `help mode` when preferred, for new users coming from Octave. +* [#16679](https://bugzilla.scilab.org/16679): `get_function_path("acosh")` yielded an error (regression from Scilab 6.0.0). ### Bugs fixed in 6.1.0: diff --git a/scilab/modules/functions/macros/get_function_path.sci b/scilab/modules/functions/macros/get_function_path.sci index 447e096..7b0ee2a 100644 --- a/scilab/modules/functions/macros/get_function_path.sci +++ b/scilab/modules/functions/macros/get_function_path.sci @@ -31,7 +31,7 @@ function path = get_function_path(name) libname = whereis(name); - if libname <> [] then + if libname <> [] & libname <> "script" & type(evstr(name))==13 then for i = 1:size(libname,"*") [funcnames, pathlib] = libraryinfo(libname(i)); path = [path ; fullfile(pathlib, name + ".sci")]; diff --git a/scilab/modules/functions/tests/nonreg_tests/bug_16679.tst b/scilab/modules/functions/tests/nonreg_tests/bug_16679.tst new file mode 100644 index 0000000..c3515db --- /dev/null +++ b/scilab/modules/functions/tests/nonreg_tests/bug_16679.tst @@ -0,0 +1,26 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2021 - Samuel GOUGEON +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- CLI SHELL MODE --> +// <-- NO CHECK REF --> +// <-- Non-regression test for bug 16679 --> +// +// <-- Bugzilla URL --> +// https://bugzilla.scilab.org/16679 +// +// <-- Short Description --> +// get_function_path("acosh") yielded an error (Scilab 6.0.0 regression) + +// builtin +assert_checkequal(get_function_path("sin"), []); +// user macro +function test(), endfunction +assert_checkequal(get_function_path("test"), []); +// macro in library +ref = pathconvert("WSCI\modules\elementary_functions\macros\sind.sci",%f,%t); +assert_checkequal(get_function_path("sind"), ref); +