comparison src/mappers.cc @ 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 67bf9b30f3f9
children 1a21c4c5eeeb 5a3983cb9912
comparison
equal deleted inserted replaced
12893:72ffa81a68d4 12894:ef5ebbf2a657
1775 @end example\n\ 1775 @end example\n\
1776 @seealso{char}\n\ 1776 @seealso{char}\n\
1777 @end deftypefn") 1777 @end deftypefn")
1778 { 1778 {
1779 octave_value retval; 1779 octave_value retval;
1780 1780 if (args.length () == 1)
1781 if (args.length () != 1)
1782 print_usage ();
1783 else if (! (args(0).is_string () || args(0).is_cellstr ()))
1784 error ("toascii: S input must be a string or cellstr");
1785 else
1786 retval = args(0).xtoascii (); 1781 retval = args(0).xtoascii ();
1782 else
1783 print_usage ();
1787 1784
1788 return retval; 1785 return retval;
1789 } 1786 }
1790 1787
1791 DEFUNX ("tolower", Ftolower, args, , 1788 DEFUNX ("tolower", Ftolower, args, ,
1804 @end example\n\ 1801 @end example\n\
1805 @seealso{toupper}\n\ 1802 @seealso{toupper}\n\
1806 @end deftypefn") 1803 @end deftypefn")
1807 { 1804 {
1808 octave_value retval; 1805 octave_value retval;
1809 1806 if (args.length () == 1)
1810 if (args.length () != 1)
1811 print_usage ();
1812 else if (! (args(0).is_string () || args(0).is_cellstr ()))
1813 error ("tolower: S input must be a string or cellstr");
1814 else
1815 retval = args(0).xtolower (); 1807 retval = args(0).xtolower ();
1808 else
1809 print_usage ();
1816 1810
1817 return retval; 1811 return retval;
1818 } 1812 }
1819 1813
1820 DEFALIAS (lower, tolower); 1814 DEFALIAS (lower, tolower);
1853 @end example\n\ 1847 @end example\n\
1854 @seealso{tolower}\n\ 1848 @seealso{tolower}\n\
1855 @end deftypefn") 1849 @end deftypefn")
1856 { 1850 {
1857 octave_value retval; 1851 octave_value retval;
1858 1852 if (args.length () == 1)
1859 if (args.length () != 1)
1860 print_usage ();
1861 else if (! (args(0).is_string () || args(0).is_cellstr ()))
1862 error ("toupper: S input must be a string or cellstr");
1863 else
1864 retval = args(0).xtoupper (); 1853 retval = args(0).xtoupper ();
1854 else
1855 print_usage ();
1865 1856
1866 return retval; 1857 return retval;
1867 } 1858 }
1868 1859
1869 DEFALIAS (upper, toupper); 1860 DEFALIAS (upper, toupper);