changeset 12718:01980844dc9c stable

colon.m: Stop issuing error if called accidentally with no arguments. * colon.m: Check nargin != 0 before issuing error.
author Rik <octave@nomad.inbox5.com>
date Wed, 08 Jun 2011 10:41:40 -0700
parents a87052630372
children 7b5bfd6a8e28
files scripts/general/colon.m
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/general/colon.m	Wed Jun 08 10:39:07 2011 -0700
+++ b/scripts/general/colon.m	Wed Jun 08 10:41:40 2011 -0700
@@ -34,5 +34,7 @@
 ## @end deftypefn
 
 function r = colon (varargin)
-  error ("colon: not defined for class \"%s\"", class(varargin{1}));
+  if (nargin != 0)
+    error ("colon: not defined for class \"%s\"", class(varargin{1}));
+  endif
 endfunction