Mercurial > hg > octave-lyh
changeset 16304:c8e1b0213e34
pkg.m: Fix str-to-num warnings (bug #37785)
* scripts/general/postpad.m: Use indexing rather than multiplication
to expand constant value.
* scripts/pkg/pkg.m: Use isbool rather than '== -1' to avoid coercing
a string to a number.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 14 Mar 2013 14:47:29 -0700 |
parents | 085976d9ef08 |
children | 23636765e00a |
files | scripts/general/postpad.m scripts/pkg/pkg.m |
diffstat | 2 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/postpad.m +++ b/scripts/general/postpad.m @@ -78,7 +78,7 @@ y = x(idx{:}); else sz (dim) = l - d; - y = cat (dim, x, c * ones (sz)); + y = cat (dim, x, c(ones (sz))); endif endfunction
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -263,7 +263,7 @@ function [local_packages, global_packages] = pkg (varargin) ## Installation prefix (FIXME: what should these be on windows?) persistent user_prefix = false; - persistent prefix = -1; + persistent prefix = false; persistent archprefix = -1; persistent local_list = tilde_expand (fullfile ("~", ".octave_packages")); persistent global_list = fullfile (OCTAVE_HOME (), "share", "octave", @@ -277,7 +277,7 @@ ## FIXME: is it OK to set this always true on windows? global_install = ((ispc () && ! isunix ()) || (geteuid () == 0)); - if (prefix == -1) + if (isbool (prefix)) if (global_install) prefix = fullfile (OCTAVE_HOME (), "share", "octave", "packages"); archprefix = fullfile (octave_config_info ("libdir"),