# HG changeset patch # User Rik # Date 1363297649 25200 # Node ID c8e1b0213e34870deb3d5701ccf480c963db3a58 # Parent 085976d9ef08f24507f926a3133aca7890714529 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. diff -r 085976d9ef08 -r c8e1b0213e34 scripts/general/postpad.m --- a/scripts/general/postpad.m Thu Mar 14 10:25:23 2013 -0700 +++ b/scripts/general/postpad.m Thu Mar 14 14:47:29 2013 -0700 @@ -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 diff -r 085976d9ef08 -r c8e1b0213e34 scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Thu Mar 14 10:25:23 2013 -0700 +++ b/scripts/pkg/pkg.m Thu Mar 14 14:47:29 2013 -0700 @@ -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"),