Mercurial > hg > octave-terminal
changeset 8883:7de0992eb123
add nargin check to strsplit
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 27 Feb 2009 08:06:25 +0100 |
parents | 8633ae24a892 |
children | 579de77acd90 |
files | scripts/ChangeLog scripts/strings/strsplit.m |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-02-27 Jaroslav Hajek <highegg@gmail.com> + + * strings/strsplit.m: Check also nargin. + 2009-02-26 John W. Eaton <jwe@octave.org> * deprecated/split.m: Add warning, not about version.
--- a/scripts/strings/strsplit.m +++ b/scripts/strings/strsplit.m @@ -23,7 +23,8 @@ ## @end deftypefn function s = strsplit (p, sep, strip_empty = false) - if (! ischar (p) || rows (p) > 1 || ! ischar (sep) || ! islogical (strip_empty)) + if (nargin < 2 || nargin > 3 || ! ischar (p) || rows (p) > 1 \ + || ! ischar (sep) || ! islogical (strip_empty)) print_usage (); endif