Karsten Hopp e71321
To: vim-dev@vim.org
Karsten Hopp e71321
Subject: patch 7.1.012
Karsten Hopp e71321
Fcc: outbox
Karsten Hopp e71321
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp e71321
Mime-Version: 1.0
Karsten Hopp e71321
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp e71321
Content-Transfer-Encoding: 8bit
Karsten Hopp e71321
------------
Karsten Hopp e71321
Karsten Hopp e71321
Patch 7.1.012
Karsten Hopp e71321
Problem:    ":let &shiftwidth = 'asdf'" doesn't produce an error message.
Karsten Hopp e71321
Solution:   Check for a string argument. (Chris Lubinski)
Karsten Hopp e71321
Files:	    src/option.c
Karsten Hopp e71321
Karsten Hopp e71321
Karsten Hopp e71321
*** ../vim-7.1.011/src/option.c	Sun May  6 15:37:32 2007
Karsten Hopp e71321
--- src/option.c	Tue Jun 19 20:56:36 2007
Karsten Hopp e71321
***************
Karsten Hopp e71321
*** 8219,8224 ****
Karsten Hopp e71321
--- 8219,8243 ----
Karsten Hopp e71321
  	    varp = get_varp(&options[opt_idx]);
Karsten Hopp e71321
  	    if (varp != NULL)	/* hidden option is not changed */
Karsten Hopp e71321
  	    {
Karsten Hopp e71321
+ 		if (number == 0 && string != NULL)
Karsten Hopp e71321
+ 		{
Karsten Hopp e71321
+ 		    int index;
Karsten Hopp e71321
+ 
Karsten Hopp e71321
+ 		    /* Either we are given a string or we are setting option
Karsten Hopp e71321
+ 		     * to zero. */
Karsten Hopp e71321
+ 		    for (index = 0; string[index] == '0'; ++index)
Karsten Hopp e71321
+ 			;
Karsten Hopp e71321
+ 		    if (string[index] != NUL || index == 0)
Karsten Hopp e71321
+ 		    {
Karsten Hopp e71321
+ 			/* There's another character after zeros or the string
Karsten Hopp e71321
+ 			 * is empty.  In both cases, we are trying to set a
Karsten Hopp e71321
+ 			 * num option using a string. */
Karsten Hopp e71321
+ 			EMSG3(_("E521: Number required: &%s = '%s'"),
Karsten Hopp e71321
+ 								name, string);
Karsten Hopp e71321
+ 			return;     /* do nothing as we hit an error */
Karsten Hopp e71321
+ 
Karsten Hopp e71321
+ 		    }
Karsten Hopp e71321
+ 		}
Karsten Hopp e71321
  		if (flags & P_NUM)
Karsten Hopp e71321
  		    (void)set_num_option(opt_idx, varp, number,
Karsten Hopp e71321
  							  NULL, 0, opt_flags);
Karsten Hopp e71321
*** ../vim-7.1.011/src/version.c	Tue Jun 19 20:30:46 2007
Karsten Hopp e71321
--- src/version.c	Tue Jun 19 20:53:15 2007
Karsten Hopp e71321
***************
Karsten Hopp e71321
*** 668,669 ****
Karsten Hopp e71321
--- 668,671 ----
Karsten Hopp e71321
  {   /* Add new patch number below this line */
Karsten Hopp e71321
+ /**/
Karsten Hopp e71321
+     12,
Karsten Hopp e71321
  /**/
Karsten Hopp e71321
Karsten Hopp e71321
-- 
Karsten Hopp e71321
Ten million Linux users can't be wrong!
Karsten Hopp e71321
Karsten Hopp e71321
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp e71321
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp e71321
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp e71321
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///