Mercurial > hg > octave-nkf
diff scripts/pkg/pkg.m @ 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 | 40a9a4e0d12a |
children | f4c8c66faf34 |
line wrap: on
line diff
--- 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"),