Mercurial > hg > octave-avbm
changeset 13865:5d928d37f159
news: fixing bug when package is not specified and core NEWS file can't be found
author | Carnë Draug <carandraug+dev@gmail.com> |
---|---|
date | Sat, 12 Nov 2011 19:26:32 +0000 |
parents | a03e96aa4977 |
children | 7908b27de857 |
files | scripts/miscellaneous/news.m |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/news.m +++ b/scripts/miscellaneous/news.m @@ -24,12 +24,11 @@ ## NEWS file for that package. ## @end deftypefn -function news (package) +function news (package = "octave") - ## also let users specify 'octave' - if (nargin == 0 || (nargin == 1 && ischar (package) && strcmpi (package, "octave"))) + if (ischar (package) && strcmpi (package, "octave")) octetcdir = octave_config_info ("octetcdir"); - newsfile = fullfile (octetcdir, "NEWS"); + newsfile = fullfile (octetcdir, "NEWS"); elseif (nargin == 1 && ischar (package)) installed = pkg ("list"); @@ -51,10 +50,10 @@ puts (line); endwhile else - if (package) + if (strcmpi (package, "octave")) + error ("news: unable to locate NEWS file"); + else error ("news: unable to locate NEWS file of %s package", package); - else - error ("news: unable to locate NEWS file"); endif endif