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