Mercurial > hg > octave-terminal
changeset 12894:ef5ebbf2a657 stable
maint: Rollback changeset 67bf9b30f3f9.
Do not error when numeric input given to toupper.
* mappers.cc (toupper, tolower, toascii): Do not emit an error when
given numeric input.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 27 Jul 2011 11:49:15 -0700 |
parents | 72ffa81a68d4 |
children | a19b50f6697f |
files | src/mappers.cc |
diffstat | 1 files changed, 9 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mappers.cc +++ b/src/mappers.cc @@ -1777,13 +1777,10 @@ @end deftypefn") { octave_value retval; - - if (args.length () != 1) + if (args.length () == 1) + retval = args(0).xtoascii (); + else print_usage (); - else if (! (args(0).is_string () || args(0).is_cellstr ())) - error ("toascii: S input must be a string or cellstr"); - else - retval = args(0).xtoascii (); return retval; } @@ -1806,13 +1803,10 @@ @end deftypefn") { octave_value retval; - - if (args.length () != 1) + if (args.length () == 1) + retval = args(0).xtolower (); + else print_usage (); - else if (! (args(0).is_string () || args(0).is_cellstr ())) - error ("tolower: S input must be a string or cellstr"); - else - retval = args(0).xtolower (); return retval; } @@ -1855,13 +1849,10 @@ @end deftypefn") { octave_value retval; - - if (args.length () != 1) + if (args.length () == 1) + retval = args(0).xtoupper (); + else print_usage (); - else if (! (args(0).is_string () || args(0).is_cellstr ())) - error ("toupper: S input must be a string or cellstr"); - else - retval = args(0).xtoupper (); return retval; }