# HG changeset patch # User Rik # Date 1379610419 25200 # Node ID c36d3a4bc42f123cc3c9c75a7c02d2aaf0c6e379 # Parent 0fa126e9944e08c0dcce9e239680090c0dd82a90 __scatter__.m: Use multiple strcmpi instead of strncmpi for accurate input validation. * scripts/plot/private/__scatter__.m: Use code 'strcmpi (...,"filled") || strcmpi (...,"fill")' instead of strncmpi (..., "filled", 4) so that stuff like "filler_up" is not allowed. diff --git a/scripts/plot/private/__scatter__.m b/scripts/plot/private/__scatter__.m --- a/scripts/plot/private/__scatter__.m +++ b/scripts/plot/private/__scatter__.m @@ -75,9 +75,9 @@ if (isvector (c) && columns (c) != 3) c = c(:); endif - ## Compare only first 4 letters of "fill" as that is what Matlab uses. elseif (firstnonnumeric == istart && ischar (varargin{istart}) - && ! strncmpi (varargin{istart}, "filled", 4)) + && ! ( strcmpi (varargin{istart}, "filled") + || strcmpi (varargin{istart}, "fill"))) c = varargin{istart}; firstnonnumeric++; else @@ -91,7 +91,7 @@ iarg = firstnonnumeric; while (iarg <= nargin) arg = varargin{iarg++}; - if (ischar (arg) && strncmpi (arg, "filled", 4)) + if (ischar (arg) && (strcmpi (arg, "filled") || strcmpi (arg, "fill"))) filled = true; elseif ((ischar (arg) || iscell (arg)) && ! have_marker) [linespec, valid] = __pltopt__ (fcn, arg, false);