changeset 32214:bc17da3679d8

maint: Merge stable to default.
author Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
date Mon, 24 Jul 2023 13:32:39 -0400
parents c8f41f5a803f (current diff) 3321783e9fe5 (diff)
children f8b53be9844e
files etc/NEWS.8.md
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS.8.md	Sun Jul 23 22:08:18 2023 +0200
+++ b/etc/NEWS.8.md	Mon Jul 24 13:32:39 2023 -0400
@@ -4,6 +4,8 @@
 For (bug #XXXXX) see https://savannah.gnu.org/bugs/?XXXXX
 
 ### Improvements and fixes
+- `ellipsoid.m`: avoid returning geometry data unless it is explicitly
+requested to avoid overwriting `ans`.
 
 ### GUI
 
--- a/scripts/plot/draw/ellipsoid.m	Sun Jul 23 22:08:18 2023 +0200
+++ b/scripts/plot/draw/ellipsoid.m	Mon Jul 24 13:32:39 2023 -0400
@@ -24,7 +24,7 @@
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn  {} {} ellipsoid (@var{xc}, @var{yc}, @var{zc}, @var{xr}, @var{yr}, @var{zr}, @var{n})
+## @deftypefn  {} {} ellipsoid (@var{xc}, @var{yc}, @var{zc}, @var{xr}, @var{yr}, @var{zr})
 ## @deftypefnx {} {} ellipsoid (@dots{}, @var{n})
 ## @deftypefnx {} {} ellipsoid (@var{hax}, @dots{})
 ## @deftypefnx {} {[@var{x}, @var{y}, @var{z}] =} ellipsoid (@dots{})
@@ -45,7 +45,7 @@
 ## @seealso{cylinder, rectangle, sphere}
 ## @end deftypefn
 
-function [xx, yy, zz] = ellipsoid (varargin)
+function [x, y, z] = ellipsoid (varargin)
 
   [hax, varargin, nargin] = __plt_get_axis_arg__ ("ellipsoid", varargin{:});
 
@@ -106,6 +106,19 @@
 %! ellipsoid (0, 0, 1, 2, 3, 4, 20);
 %! title ("ellipsoid()");
 
+%!test <*64468> # No return if nargout = 0
+%! hf = figure ("visible", "off");
+%! hax = gca ();
+%! unwind_protect
+%!   1 + 1;
+%!   assert (ans, 2);
+%!   ellipsoid (hax, 0, 0, 0, 1, 1, 1);
+%!   assert (ans, 2);
+%!
+%!  unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+
 ## Test input validation
 %!error <Invalid call> ellipsoid (1,2,3,4,5)
 %!error <Invalid call> ellipsoid (1,2,3,4,5,6,7,8)