# HG changeset patch # User Arun Giridhar # Date 1712671328 14400 # Node ID fc12e1f3cd5dde87517221c73fbb06d1ab4f7eae # Parent 9108c5b24626abd6f1a02c1735c52a7022806498# Parent 90fb783da7877a3754ed7f923976a4cf0d84e576 maint: Merge default to bytecode-interpreter diff -r 9108c5b24626 -r fc12e1f3cd5d etc/NEWS.10.md --- a/etc/NEWS.10.md Mon Apr 08 21:00:39 2024 -0400 +++ b/etc/NEWS.10.md Tue Apr 09 10:02:08 2024 -0400 @@ -58,6 +58,12 @@ - `cross` now produces row vector outputs when the inputs are a mix of row and column vectors. (bug #61295) +- Octave functions whose Matlab equivalents give errors when passed non-integer +values as sizes or dimensions now also give similar errors. +E.g., `cell (e, pi)` now gives an error in Octave about requiring integer +sizes for the cell array, matching Matlab behavior. +Previously, Octave's conversion from non-integers to integers was more lenient. + ### Alphabetical list of new functions added in Octave 10 * `clim` diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/__eigs__.cc --- a/libinterp/corefcn/__eigs__.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/__eigs__.cc Tue Apr 09 10:02:08 2024 -0400 @@ -345,7 +345,7 @@ if (tmp.numel () != 1) error ("eigs: OPTS.issym must be a scalar value"); - symmetric = tmp.xbool_value ("eigs: OPTS.issym must be a logical value"); + symmetric = tmp.ybool_value ("eigs: OPTS.issym must be a logical value"); sym_tested = true; } @@ -358,7 +358,7 @@ if (tmp.numel () != 1) error ("eigs: OPTS.isreal must be a scalar value"); - a_is_complex = ! tmp.xbool_value ("eigs: OPTS.isreal must be a logical value"); + a_is_complex = ! tmp.ybool_value ("eigs: OPTS.isreal must be a logical value"); } } diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/besselj.cc --- a/libinterp/corefcn/besselj.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/besselj.cc Tue Apr 09 10:02:08 2024 -0400 @@ -598,7 +598,7 @@ } else { - octave_idx_type kind = args(1).xint_value ("besselh: invalid value of K"); + octave_idx_type kind = args(1).yint_value ("besselh: invalid value of K"); octave_value_list tmp_args; @@ -687,13 +687,13 @@ int kind = 0; if (nargin > 1) { - kind = args(0).xint_value ("airy: K must be an integer value"); + kind = args(0).yint_value ("airy: K must be an integer value"); if (kind < 0 || kind > 3) error ("airy: K must be 0, 1, 2, or 3"); } - bool scale = (nargin == 3) && args(2).xbool_value ("airy: scale option must be a logical value"); + bool scale = (nargin == 3) && args(2).ybool_value ("airy: scale option must be a logical value"); int idx = (nargin == 1 ? 0 : 1); diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/bitfcns.cc --- a/libinterp/corefcn/bitfcns.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/bitfcns.cc Tue Apr 09 10:02:08 2024 -0400 @@ -583,7 +583,7 @@ if (args(2).numel () > 1) error ("bitshift: N must be a scalar integer"); - nbits = args(2).xint_value ("bitshift: N must be an integer"); + nbits = args(2).yint_value ("bitshift: N must be an integer"); if (nbits < 0) error ("bitshift: N must be positive"); diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/data.cc Tue Apr 09 10:02:08 2024 -0400 @@ -96,7 +96,7 @@ print_usage (); int dim = (nargin == 1 ? -1 - : args(1).xint_value ("all: DIM must be an integer")-1); + : args(1).yint_value ("all: DIM must be an integer")-1); if (dim < -1) error ("all: invalid dimension argument = %d", dim + 1); @@ -161,7 +161,7 @@ print_usage (); int dim = (nargin == 1 ? -1 - : args(1).xint_value ("any: DIM must be an integer")-1); + : args(1).yint_value ("any: DIM must be an integer")-1); if (dim < -1) error ("any: invalid dimension argument = %d", dim + 1); @@ -1267,7 +1267,7 @@ retval = args(0).diag (); else if (nargin == 2) { - octave_idx_type k = args(1).xidx_type_value ("diag: invalid argument K"); + octave_idx_type k = args(1).yidx_type_value ("diag: invalid argument K"); retval = args(0).diag (k); } @@ -1278,8 +1278,8 @@ if (arg0.ndims () != 2 || (arg0.rows () != 1 && arg0.columns () != 1)) error ("diag: V must be a vector"); - octave_idx_type m = args(1).xidx_type_value ("diag: invalid dimension M"); - octave_idx_type n = args(2).xidx_type_value ("diag: invalid dimension N"); + octave_idx_type m = args(1).yidx_type_value ("diag: invalid dimension M"); + octave_idx_type n = args(2).yidx_type_value ("diag: invalid dimension N"); retval = arg0.diag (m, n); } @@ -2375,7 +2375,7 @@ if (args.length () == 0) print_usage (); - int dim = args(0).xint_value ("cat: DIM must be an integer") - 1; + int dim = args(0).yint_value ("cat: DIM must be an integer") - 1; if (dim < 0) error ("cat: DIM must be a valid dimension"); diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/file-io.cc --- a/libinterp/corefcn/file-io.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/file-io.cc Tue Apr 09 10:02:08 2024 -0400 @@ -3223,7 +3223,7 @@ if (args.length () != 1) print_usage (); - int mask = args(0).xint_value ("umask: MASK must be an integer"); + int mask = args(0).yint_value ("umask: MASK must be an integer"); if (mask < 0) error ("umask: MASK must be a positive integer value"); diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/interpreter.cc --- a/libinterp/corefcn/interpreter.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/interpreter.cc Tue Apr 09 10:02:08 2024 -0400 @@ -290,7 +290,7 @@ std::string arg = args(0).xstring_value ("atexit: FCN argument must be a string"); bool add_mode = (nargin == 2) - ? args(1).xbool_value ("atexit: FLAG argument must be a logical value") + ? args(1).ybool_value ("atexit: FLAG argument must be a logical value") : true; octave_value_list retval; diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/jsondecode.cc --- a/libinterp/corefcn/jsondecode.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/jsondecode.cc Tue Apr 09 10:02:08 2024 -0400 @@ -601,7 +601,7 @@ "option argument must be a string"); if (string::strcmpi (parameter, "makeValidName")) { - use_makeValidName = args(i + 1).xbool_value ("jsondecode: " + use_makeValidName = args(i + 1).ybool_value ("jsondecode: " "'makeValidName' value must be a bool"); } else diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/load-path.cc Tue Apr 09 10:02:08 2024 -0400 @@ -2707,7 +2707,7 @@ } else if (option_arg.isnumeric ()) { - int val = option_arg.xint_value ("addpath: OPTION must be '-begin'/0 or '-end'/1"); + int val = option_arg.yint_value ("addpath: OPTION must be '-begin'/0 or '-end'/1"); if (val == 0) nargin--; diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/oct-stream.cc Tue Apr 09 10:02:08 2024 -0400 @@ -3682,7 +3682,7 @@ } else if (param == "collectoutput") { - m_collect_output = args(i+1).xbool_value ("%s: CollectOutput must be logical or numeric", + m_collect_output = args(i+1).ybool_value ("%s: CollectOutput must be logical or numeric", m_who.c_str ()); } else if (param == "emptyvalue") @@ -3700,11 +3700,11 @@ else if (param == "multipledelimsasone") { m_multiple_delims_as_one = args(i - +1).xbool_value ("%s: MultipleDelimsAsOne must be logical or numeric", m_who.c_str ()); + +1).ybool_value ("%s: MultipleDelimsAsOne must be logical or numeric", m_who.c_str ()); } else if (param == "returnonerror") { - m_return_on_error = args(i+1).xbool_value ("%s: ReturnOnError must be logical or numeric", + m_return_on_error = args(i+1).ybool_value ("%s: ReturnOnError must be logical or numeric", m_who.c_str ()); } else if (param == "whitespace") diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/psi.cc --- a/libinterp/corefcn/psi.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/psi.cc Tue Apr 09 10:02:08 2024 -0400 @@ -78,7 +78,7 @@ print_usage (); const octave_value oct_z = (nargin == 1) ? args(0) : args(1); - const octave_idx_type k = (nargin == 1) ? 0 : args(0).xidx_type_value ("psi: K must be an integer"); + const octave_idx_type k = (nargin == 1) ? 0 : args(0).yidx_type_value ("psi: K must be an integer"); if (k < 0) error ("psi: K must be non-negative"); diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/sparse.cc --- a/libinterp/corefcn/sparse.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/sparse.cc Tue Apr 09 10:02:08 2024 -0400 @@ -199,8 +199,8 @@ } else if (nargin == 2) { - octave_idx_type m = args(0).xidx_type_value ("sparse: M must be a non-negative integer"); - octave_idx_type n = args(1).xidx_type_value ("sparse: N must be a non-negative integer"); + octave_idx_type m = args(0).yidx_type_value ("sparse: M must be a non-negative integer"); + octave_idx_type n = args(1).yidx_type_value ("sparse: N must be a non-negative integer"); if (m < 0 || n < 0) error ("sparse: dimensions M and N must be non-negative"); @@ -233,8 +233,8 @@ if (nargin == 5) { - m = args(3).xidx_type_value ("sparse: M must be a non-negative integer"); - n = args(4).xidx_type_value ("sparse: N must be a non-negative integer"); + m = args(3).yidx_type_value ("sparse: M must be a non-negative integer"); + n = args(4).yidx_type_value ("sparse: N must be a non-negative integer"); if (m < 0 || n < 0) error ("sparse: dimensions M and N must be non-negative"); diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/strfns.cc --- a/libinterp/corefcn/strfns.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/strfns.cc Tue Apr 09 10:02:08 2024 -0400 @@ -1221,7 +1221,7 @@ int width = -1; if (nargin > 1 && ! args(1).isempty ()) - width = args(1).xint_value ("list_in_columns: WIDTH must be an integer"); + width = args(1).yint_value ("list_in_columns: WIDTH must be an integer"); std::string prefix; diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/syscalls.cc --- a/libinterp/corefcn/syscalls.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/syscalls.cc Tue Apr 09 10:02:08 2024 -0400 @@ -465,10 +465,8 @@ if (fid < 0) error ("fcntl: invalid file id FID"); - // FIXME: Do we want to use xint_value and throw a warning message - // if input validation fails? - int req = args(1).int_value (true); - int arg = args(2).int_value (true); + int req = args(1).yint_value ("fcntl: REQUEST must be an integer"); + int arg = args(2).yint_value ("fcntl: ARG must be an integer"); octave_value_list retval; std::string msg; @@ -743,7 +741,7 @@ std::string name = args(0).xstring_value ("mkfifo: FILE must be a string"); - int octal_mode = args(1).xint_value ("mkfifo: MODE must be an integer"); + int octal_mode = args(1).yint_value ("mkfifo: MODE must be an integer"); if (octal_mode < 0) error ("mkfifo: MODE must be a positive integer value"); @@ -1260,12 +1258,12 @@ if (nargin != 1 && nargin != 2) print_usage (); - pid_t pid = args(0).xint_value ("waitpid: OPTIONS must be an integer"); + pid_t pid = args(0).yint_value ("waitpid: OPTIONS must be an integer"); int options = 0; if (nargin == 2) - options = args(1).xint_value ("waitpid: PID must be an integer value"); + options = args(1).yint_value ("waitpid: PID must be an integer value"); std::string msg; int status; @@ -1287,7 +1285,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).xint_value ("WIFEXITED: STATUS must be an integer"); + int status = args(0).yint_value ("WIFEXITED: STATUS must be an integer"); return ovl (sys::wifexited (status)); } @@ -1306,7 +1304,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).xint_value ("WEXITSTATUS: STATUS must be an integer"); + int status = args(0).yint_value ("WEXITSTATUS: STATUS must be an integer"); return ovl (sys::wexitstatus (status)); } @@ -1323,7 +1321,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).xint_value ("WIFSIGNALED: STATUS must be an integer"); + int status = args(0).yint_value ("WIFSIGNALED: STATUS must be an integer"); return ovl (sys::wifsignaled (status)); } @@ -1342,7 +1340,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).xint_value ("WTERMSIG: STATUS must be an integer"); + int status = args(0).yint_value ("WTERMSIG: STATUS must be an integer"); return ovl (sys::wtermsig (status)); } @@ -1363,7 +1361,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).xint_value ("WCOREDUMP: STATUS must be an integer"); + int status = args(0).yint_value ("WCOREDUMP: STATUS must be an integer"); return ovl (sys::wcoredump (status)); } @@ -1383,7 +1381,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).xint_value ("WIFSTOPPED: STATUS must be an integer"); + int status = args(0).yint_value ("WIFSTOPPED: STATUS must be an integer"); return ovl (sys::wifstopped (status)); } @@ -1402,7 +1400,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).xint_value ("WSTOPSIG: STATUS must be an integer"); + int status = args(0).yint_value ("WSTOPSIG: STATUS must be an integer"); return ovl (sys::wstopsig (status)); } @@ -1419,7 +1417,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).xint_value ("WIFCONTINUED: STATUS must be an integer"); + int status = args(0).yint_value ("WIFCONTINUED: STATUS must be an integer"); return ovl (sys::wifcontinued (status)); } diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/time.cc --- a/libinterp/corefcn/time.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/time.cc Tue Apr 09 10:02:08 2024 -0400 @@ -69,7 +69,7 @@ octave_value v = m.getfield (k); if (! v.isempty ()) - retval = v.xint_value ("%s: invalid TM_STRUCT argument", who); + retval = v.yint_value ("%s: invalid TM_STRUCT argument", who); return retval; } diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/utils.cc Tue Apr 09 10:02:08 2024 -0400 @@ -1295,7 +1295,7 @@ } else { - int val = args(0).xint_value ("errno: argument must be string or integer"); + int val = args(0).yint_value ("errno: argument must be string or integer"); retval = octave_errno::set (val); } diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/corefcn/variables.cc Tue Apr 09 10:02:08 2024 -0400 @@ -601,7 +601,7 @@ if (nargin == 1) { - bool bval = args(0).xbool_value ("%s: argument must be a logical value", nm); + bool bval = args(0).ybool_value ("%s: argument must be a logical value", nm); var = bval; } @@ -675,7 +675,7 @@ if (nargin == 1) { - int ival = args(0).xint_value ("%s: argument must be an integer value", nm); + int ival = args(0).yint_value ("%s: argument must be an integer value", nm); if (ival < minval) error ("%s: arg must be greater than %d", nm, minval); diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/dldfcn/__glpk__.cc --- a/libinterp/dldfcn/__glpk__.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/dldfcn/__glpk__.cc Tue Apr 09 10:02:08 2024 -0400 @@ -332,7 +332,7 @@ if (tmp.is_defined ()) \ { \ if (! tmp.isempty ()) \ - VAL = tmp.xint_value ("glpk: invalid value in PARAM" NAME); \ + VAL = tmp.yint_value ("glpk: invalid value in PARAM" NAME); \ else \ error ("glpk: invalid value in PARAM" NAME); \ } \ diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/dldfcn/__ode15__.cc --- a/libinterp/dldfcn/__ode15__.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/dldfcn/__ode15__.cc Tue Apr 09 10:02:08 2024 -0400 @@ -1350,7 +1350,7 @@ // Provided number of arguments in the ode callback function octave_idx_type num_event_args - = args(5).xidx_type_value ("__ode15__: NUM_EVENT_ARGS must be an integer"); + = args(5).yidx_type_value ("__ode15__: NUM_EVENT_ARGS must be an integer"); if (num_event_args != 2 && num_event_args != 3) error ("__ode15__: number of input arguments in event callback must be 2 or 3"); diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/octave-value/ov-cell.cc --- a/libinterp/octave-value/ov-cell.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/octave-value/ov-cell.cc Tue Apr 09 10:02:08 2024 -0400 @@ -1237,7 +1237,7 @@ for (int i = 0; i < nargin; i++) dims(i) = (args(i).isempty () - ? 0 : args(i).xidx_type_value ("cell: dimension must be a scalar integer")); + ? 0 : args(i).yidx_type_value ("cell: dimension must be a scalar integer")); } break; } diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/octave-value/ov.cc Tue Apr 09 10:02:08 2024 -0400 @@ -1723,6 +1723,16 @@ #endif } +octave_idx_type +octave_value::strict_idx_type_value (bool frc_str_conv) const +{ +#if defined (OCTAVE_ENABLE_64) + return int64_value (true, frc_str_conv); +#else + return int_value (true, frc_str_conv); +#endif +} + Cell octave_value::cell_value () const { @@ -2201,8 +2211,19 @@ XVALUE_EXTRACTOR (octave_value_list, xlist_value, list_value) +// Make some stricter versions of XVALUE_EXTRACTOR, +// especially for parsing integer arguments that cannot be floating point. +// See bug #65538. + +XVALUE_EXTRACTOR (int, yint_value, strict_int_value) + +XVALUE_EXTRACTOR (bool, ybool_value, strict_bool_value) + +XVALUE_EXTRACTOR (octave_idx_type, yidx_type_value, strict_idx_type_value) + #undef XVALUE_EXTRACTOR + octave_value octave_value::storable_value () const { diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/octave-value/ov.h Tue Apr 09 10:02:08 2024 -0400 @@ -821,6 +821,9 @@ int int_value (bool req_int = false, bool frc_str_conv = false) const { return m_rep->int_value (req_int, frc_str_conv); } + int strict_int_value (bool frc_str_conv = false) const + { return m_rep->int_value (true, frc_str_conv); } + unsigned int uint_value (bool req_int = false, bool frc_str_conv = false) const { return m_rep->uint_value (req_int, frc_str_conv); } @@ -847,6 +850,9 @@ octave_idx_type idx_type_value (bool req_int = false, bool frc_str_conv = false) const; + octave_idx_type + strict_idx_type_value (bool frc_str_conv = false) const; + double double_value (bool frc_str_conv = false) const { return m_rep->double_value (frc_str_conv); } @@ -894,6 +900,9 @@ bool bool_value (bool warn = false) const { return m_rep->bool_value (warn); } + bool strict_bool_value () const + { return m_rep->bool_value (true); } + boolMatrix bool_matrix_value (bool warn = false) const { return m_rep->bool_matrix_value (warn); } @@ -1113,6 +1122,8 @@ OCTINTERP_API int xint_value (const char *fmt, ...) const; + OCTINTERP_API int yint_value (const char *fmt, ...) const; + OCTINTERP_API unsigned int xuint_value (const char *fmt, ...) const; OCTINTERP_API int xnint_value (const char *fmt, ...) const; @@ -1127,6 +1138,8 @@ OCTINTERP_API octave_idx_type xidx_type_value (const char *fmt, ...) const; + OCTINTERP_API octave_idx_type yidx_type_value (const char *fmt, ...) const; + OCTINTERP_API double xdouble_value (const char *fmt, ...) const; OCTINTERP_API float xfloat_value (const char *fmt, ...) const; @@ -1161,6 +1174,8 @@ OCTINTERP_API bool xbool_value (const char *fmt, ...) const; + OCTINTERP_API bool ybool_value (const char *fmt, ...) const; + OCTINTERP_API boolMatrix xbool_matrix_value (const char *fmt, ...) const; OCTINTERP_API boolNDArray xbool_array_value (const char *fmt, ...) const; diff -r 9108c5b24626 -r fc12e1f3cd5d libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Mon Apr 08 21:00:39 2024 -0400 +++ b/libinterp/parse-tree/pt-eval.cc Tue Apr 09 10:02:08 2024 -0400 @@ -5171,13 +5171,13 @@ if (nargin == 3) { octave_idx_type index_position - = args(1).xidx_type_value ("end: K must be integer value"); + = args(1).yidx_type_value ("end: K must be integer value"); if (index_position < 1) error ("end: K must be greater than zero"); octave_idx_type num_indices - = args(2).xidx_type_value ("end: N must be integer value"); + = args(2).yidx_type_value ("end: N must be integer value"); if (num_indices < 1) error ("end: N must be greater than zero"); @@ -5712,7 +5712,7 @@ if (! dims.all_ones ()) error ("inputname: N must be a scalar index"); - int n = args(0).xint_value ("inputname: N must be a scalar index"); + int n = args(0).yint_value ("inputname: N must be a scalar index"); if (n < 1) error ("inputname: N must be a scalar index"); @@ -5720,7 +5720,7 @@ bool ids_only = true; if (nargin == 2) - ids_only = args(1).xbool_value ("inputname: IDS_ONLY must be a logical value"); + ids_only = args(1).ybool_value ("inputname: IDS_ONLY must be a logical value"); // Use zero-based indexing internally. return ovl (interp.inputname (n-1, ids_only)); diff -r 9108c5b24626 -r fc12e1f3cd5d scripts/path/savepath.m --- a/scripts/path/savepath.m Mon Apr 08 21:00:39 2024 -0400 +++ b/scripts/path/savepath.m Tue Apr 09 10:02:08 2024 -0400 @@ -126,6 +126,11 @@ [pkg_user, pkg_system], "uniformoutput", false)]); + ## If there are packages without binaries (or without .m files), their + ## "archprefix" (or "dir") field might be empty. Remove empty paths before + ## trying to match the regular expression in the next step. + pkg_path(cellfun (@isempty, pkg_path)) = []; + ## Rely on Octave's initialization to include the pkg path elements. for i_pkg = 1:numel (pkg_path) ## Remove all paths that are (sub-)folders of a package folder.