Karsten Hopp 81c285
To: vim-dev@vim.org
Karsten Hopp 81c285
Subject: Patch 7.2.149
Karsten Hopp 81c285
Fcc: outbox
Karsten Hopp 81c285
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 81c285
Mime-Version: 1.0
Karsten Hopp 81c285
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 81c285
Content-Transfer-Encoding: 8bit
Karsten Hopp 81c285
------------
Karsten Hopp 81c285
Karsten Hopp 81c285
Patch 7.2.149
Karsten Hopp 81c285
Problem:    Using return value of function that doesn't return a value results
Karsten Hopp 81c285
	    in reading uninitialized memory.
Karsten Hopp 81c285
Solution:   Set the default to return zero.  Make cursor() return -1 on
Karsten Hopp 81c285
	    failure.  Let complete() return an empty string in case of an
Karsten Hopp 81c285
	    error.  (partly by Dominique Pelle)
Karsten Hopp 81c285
Files:	    runtime/doc/eval.txt, src/eval.c
Karsten Hopp 81c285
Karsten Hopp 81c285
Karsten Hopp 81c285
*** ../vim-7.2.148/runtime/doc/eval.txt	Tue Dec  9 10:56:50 2008
Karsten Hopp 81c285
--- runtime/doc/eval.txt	Sun Mar 22 14:28:49 2009
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 2414,2419 ****
Karsten Hopp 81c285
--- 2419,2425 ----
Karsten Hopp 81c285
  		When 'virtualedit' is used {off} specifies the offset in
Karsten Hopp 81c285
  		screen columns from the start of the character.  E.g., a
Karsten Hopp 81c285
  		position within a <Tab> or after the last character.
Karsten Hopp 81c285
+ 		Returns 0 when the position could be set, -1 otherwise.
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  deepcopy({expr}[, {noref}])				*deepcopy()* *E698*
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 4516,4521 ****
Karsten Hopp 81c285
--- 4526,4532 ----
Karsten Hopp 81c285
  		should also work to move files across file systems.  The
Karsten Hopp 81c285
  		result is a Number, which is 0 if the file was renamed
Karsten Hopp 81c285
  		successfully, and non-zero when the renaming failed.
Karsten Hopp 81c285
+ 		NOTE: If {to} exists it is overwritten without warning.
Karsten Hopp 81c285
  		This function is not available in the |sandbox|.
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  repeat({expr}, {count})					*repeat()*
Karsten Hopp 81c285
*** ../vim-7.2.148/src/eval.c	Wed Feb  4 16:25:53 2009
Karsten Hopp 81c285
--- src/eval.c	Sun Mar 22 20:45:18 2009
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 1285,1291 ****
Karsten Hopp 81c285
--- 1285,1293 ----
Karsten Hopp 81c285
      typval_T	tv;
Karsten Hopp 81c285
      char_u	*retval;
Karsten Hopp 81c285
      garray_T	ga;
Karsten Hopp 81c285
+ #ifdef FEAT_FLOAT
Karsten Hopp 81c285
      char_u	numbuf[NUMBUFLEN];
Karsten Hopp 81c285
+ #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (eval0(arg, &tv, nextcmd, TRUE) == FAIL)
Karsten Hopp 81c285
  	retval = NULL;
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 8018,8024 ****
Karsten Hopp 81c285
      /* execute the function if no errors detected and executing */
Karsten Hopp 81c285
      if (evaluate && error == ERROR_NONE)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
! 	rettv->v_type = VAR_NUMBER;	/* default is number rettv */
Karsten Hopp 81c285
  	error = ERROR_UNKNOWN;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  	if (!builtin_function(fname))
Karsten Hopp 81c285
--- 8020,8027 ----
Karsten Hopp 81c285
      /* execute the function if no errors detected and executing */
Karsten Hopp 81c285
      if (evaluate && error == ERROR_NONE)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
! 	rettv->v_type = VAR_NUMBER;	/* default rettv is number zero */
Karsten Hopp 81c285
! 	rettv->vval.v_number = 0;
Karsten Hopp 81c285
  	error = ERROR_UNKNOWN;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  	if (!builtin_function(fname))
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 8268,8274 ****
Karsten Hopp 81c285
  		return;
Karsten Hopp 81c285
  	    li = l->lv_first;
Karsten Hopp 81c285
  	}
Karsten Hopp 81c285
- 	rettv->vval.v_number = 0;	/* Default: Success */
Karsten Hopp 81c285
  	for (;;)
Karsten Hopp 81c285
  	{
Karsten Hopp 81c285
  	    if (l == NULL)
Karsten Hopp 81c285
--- 8271,8276 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 8728,8734 ****
Karsten Hopp 81c285
      int		dummy;
Karsten Hopp 81c285
      dict_T	*selfdict = NULL;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[1].v_type != VAR_LIST)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	EMSG(_(e_listreq));
Karsten Hopp 81c285
--- 8730,8735 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 9036,9048 ****
Karsten Hopp 81c285
      if (buttons == NULL || *buttons == NUL)
Karsten Hopp 81c285
  	buttons = (char_u *)_("&Ok");
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     if (error)
Karsten Hopp 81c285
! 	rettv->vval.v_number = 0;
Karsten Hopp 81c285
!     else
Karsten Hopp 81c285
  	rettv->vval.v_number = do_dialog(type, NULL, message, buttons,
Karsten Hopp 81c285
  								   def, NULL);
Karsten Hopp 81c285
- #else
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 9037,9045 ----
Karsten Hopp 81c285
      if (buttons == NULL || *buttons == NUL)
Karsten Hopp 81c285
  	buttons = (char_u *)_("&Ok");
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     if (!error)
Karsten Hopp 81c285
  	rettv->vval.v_number = do_dialog(type, NULL, message, buttons,
Karsten Hopp 81c285
  								   def, NULL);
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 9181,9195 ****
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      rettv->vval.v_number = cs_connection(num, dbpath, prepend);
Karsten Hopp 81c285
- #else
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
   * "cursor(lnum, col)" function
Karsten Hopp 81c285
   *
Karsten Hopp 81c285
!  * Moves the cursor to the specified line and column
Karsten Hopp 81c285
   */
Karsten Hopp 81c285
  /*ARGSUSED*/
Karsten Hopp 81c285
      static void
Karsten Hopp 81c285
--- 9178,9191 ----
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      rettv->vval.v_number = cs_connection(num, dbpath, prepend);
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
   * "cursor(lnum, col)" function
Karsten Hopp 81c285
   *
Karsten Hopp 81c285
!  * Moves the cursor to the specified line and column.
Karsten Hopp 81c285
!  * Returns 0 when the position could be set, -1 otherwise.
Karsten Hopp 81c285
   */
Karsten Hopp 81c285
  /*ARGSUSED*/
Karsten Hopp 81c285
      static void
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 9202,9207 ****
Karsten Hopp 81c285
--- 9198,9204 ----
Karsten Hopp 81c285
      long	coladd = 0;
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
+     rettv->vval.v_number = -1;
Karsten Hopp 81c285
      if (argvars[1].v_type == VAR_UNKNOWN)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	pos_T	    pos;
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 9246,9251 ****
Karsten Hopp 81c285
--- 9243,9249 ----
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      curwin->w_set_curswant = TRUE;
Karsten Hopp 81c285
+     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 9291,9298 ****
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
  #ifdef FEAT_AUTOCMD
Karsten Hopp 81c285
      rettv->vval.v_number = did_filetype;
Karsten Hopp 81c285
- #else
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 9289,9294 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 9605,9611 ****
Karsten Hopp 81c285
      typval_T	*argvars;
Karsten Hopp 81c285
      typval_T	*rettv;
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	list_T		*l1, *l2;
Karsten Hopp 81c285
--- 9601,9606 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 9733,9739 ****
Karsten Hopp 81c285
      if (check_secure())
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      keys = get_tv_string(&argvars[0]);
Karsten Hopp 81c285
      if (*keys != NUL)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
--- 9728,9733 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 9901,9907 ****
Karsten Hopp 81c285
      char_u	*ermsg = map ? (char_u *)"map()" : (char_u *)"filter()";
Karsten Hopp 81c285
      int		save_did_emsg;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type == VAR_LIST)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	if ((l = argvars[0].vval.v_list) == NULL
Karsten Hopp 81c285
--- 9895,9900 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 10084,10091 ****
Karsten Hopp 81c285
  	else
Karsten Hopp 81c285
  	    rettv->vval.v_number = (varnumber_T)f;
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
-     else
Karsten Hopp 81c285
- 	rettv->vval.v_number = 0;
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
--- 10077,10082 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 10219,10227 ****
Karsten Hopp 81c285
      lnum = get_tv_lnum(argvars);
Karsten Hopp 81c285
      if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
Karsten Hopp 81c285
  	rettv->vval.v_number = foldLevel(lnum);
Karsten Hopp 81c285
-     else
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
- 	rettv->vval.v_number = 0;
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
--- 10210,10216 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 10337,10343 ****
Karsten Hopp 81c285
      typval_T	*argvars;
Karsten Hopp 81c285
      typval_T	*rettv;
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #ifdef FEAT_GUI
Karsten Hopp 81c285
      if (gui.in_use)
Karsten Hopp 81c285
  	gui_mch_set_foreground();
Karsten Hopp 81c285
--- 10326,10331 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 10359,10365 ****
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
      char_u	*s;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      s = get_tv_string(&argvars[0]);
Karsten Hopp 81c285
      if (s == NULL || *s == NUL || VIM_ISDIGIT(*s))
Karsten Hopp 81c285
  	EMSG2(_(e_invarg2), s);
Karsten Hopp 81c285
--- 10347,10352 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 10429,10437 ****
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (tv == NULL)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
! 	if (argvars[2].v_type == VAR_UNKNOWN)
Karsten Hopp 81c285
! 	    rettv->vval.v_number = 0;
Karsten Hopp 81c285
! 	else
Karsten Hopp 81c285
  	    copy_tv(&argvars[2], rettv);
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
      else
Karsten Hopp 81c285
--- 10416,10422 ----
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (tv == NULL)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
! 	if (argvars[2].v_type != VAR_UNKNOWN)
Karsten Hopp 81c285
  	    copy_tv(&argvars[2], rettv);
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
      else
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 10456,10468 ****
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
      char_u	*p;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     if (retlist)
Karsten Hopp 81c285
!     {
Karsten Hopp 81c285
! 	if (rettv_list_alloc(rettv) == FAIL)
Karsten Hopp 81c285
! 	    return;
Karsten Hopp 81c285
!     }
Karsten Hopp 81c285
!     else
Karsten Hopp 81c285
! 	rettv->vval.v_number = 0;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (buf == NULL || buf->b_ml.ml_mfp == NULL || start < 0)
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
--- 10441,10448 ----
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
      char_u	*p;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     if (retlist && rettv_list_alloc(rettv) == FAIL)
Karsten Hopp 81c285
! 	return;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (buf == NULL || buf->b_ml.ml_mfp == NULL || start < 0)
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 11009,11016 ****
Karsten Hopp 81c285
      dict_T	*dict;
Karsten Hopp 81c285
      matchitem_T	*cur = curwin->w_match_head;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
- 
Karsten Hopp 81c285
      if (rettv_list_alloc(rettv) == OK)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	while (cur != NULL)
Karsten Hopp 81c285
--- 10989,10994 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 11089,11095 ****
Karsten Hopp 81c285
      win_T	*wp;
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #ifdef FEAT_QUICKFIX
Karsten Hopp 81c285
      if (rettv_list_alloc(rettv) == OK)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
--- 11067,11072 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 11935,11941 ****
Karsten Hopp 81c285
      typval_T	*argvars;
Karsten Hopp 81c285
      typval_T	*rettv;
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type != VAR_DICT)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	EMSG(_(e_dictreq));
Karsten Hopp 81c285
--- 11912,11917 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 12052,12059 ****
Karsten Hopp 81c285
  	n = del_history_entry(get_histtype(str),
Karsten Hopp 81c285
  				      get_tv_string_buf(&argvars[1], buf));
Karsten Hopp 81c285
      rettv->vval.v_number = n;
Karsten Hopp 81c285
- #else
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 12028,12033 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 12415,12421 ****
Karsten Hopp 81c285
      int		selected;
Karsten Hopp 81c285
      int		mouse_used;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #ifdef NO_CONSOLE_INPUT
Karsten Hopp 81c285
      /* While starting up, there is no place to enter text. */
Karsten Hopp 81c285
      if (no_console_input())
Karsten Hopp 81c285
--- 12389,12394 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 12464,12470 ****
Karsten Hopp 81c285
  	--ga_userinput.ga_len;
Karsten Hopp 81c285
  	restore_typeahead((tasave_T *)(ga_userinput.ga_data)
Karsten Hopp 81c285
  						       + ga_userinput.ga_len);
Karsten Hopp 81c285
! 	rettv->vval.v_number = 0; /* OK */
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
      else if (p_verbose > 1)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
--- 12437,12443 ----
Karsten Hopp 81c285
  	--ga_userinput.ga_len;
Karsten Hopp 81c285
  	restore_typeahead((tasave_T *)(ga_userinput.ga_data)
Karsten Hopp 81c285
  						       + ga_userinput.ga_len);
Karsten Hopp 81c285
! 	/* default return is zero == OK */
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
      else if (p_verbose > 1)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 12488,12494 ****
Karsten Hopp 81c285
  	save_typeahead((tasave_T *)(ga_userinput.ga_data)
Karsten Hopp 81c285
  						       + ga_userinput.ga_len);
Karsten Hopp 81c285
  	++ga_userinput.ga_len;
Karsten Hopp 81c285
! 	rettv->vval.v_number = 0; /* OK */
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
      else
Karsten Hopp 81c285
  	rettv->vval.v_number = 1; /* Failed */
Karsten Hopp 81c285
--- 12461,12467 ----
Karsten Hopp 81c285
  	save_typeahead((tasave_T *)(ga_userinput.ga_data)
Karsten Hopp 81c285
  						       + ga_userinput.ga_len);
Karsten Hopp 81c285
  	++ga_userinput.ga_len;
Karsten Hopp 81c285
! 	/* default return is zero == OK */
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
      else
Karsten Hopp 81c285
  	rettv->vval.v_number = 1; /* Failed */
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 12522,12528 ****
Karsten Hopp 81c285
      list_T	*l;
Karsten Hopp 81c285
      int		error = FALSE;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type != VAR_LIST)
Karsten Hopp 81c285
  	EMSG2(_(e_listarg), "insert()");
Karsten Hopp 81c285
      else if ((l = argvars[0].vval.v_list) != NULL
Karsten Hopp 81c285
--- 12495,12500 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 12641,12647 ****
Karsten Hopp 81c285
      dict_T	*d;
Karsten Hopp 81c285
      int		todo;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type != VAR_DICT)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	EMSG(_(e_dictreq));
Karsten Hopp 81c285
--- 12613,12618 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 12729,12735 ****
Karsten Hopp 81c285
      garray_T	ga;
Karsten Hopp 81c285
      char_u	*sep;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type != VAR_LIST)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	EMSG(_(e_listreq));
Karsten Hopp 81c285
--- 12700,12705 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 12827,12835 ****
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      rettv->v_type = type;
Karsten Hopp 81c285
!     if (type == VAR_NUMBER)
Karsten Hopp 81c285
! 	rettv->vval.v_number = 0;
Karsten Hopp 81c285
!     else
Karsten Hopp 81c285
  	rettv->vval.v_string = NULL;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (check_restricted() || check_secure())
Karsten Hopp 81c285
--- 12797,12803 ----
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      rettv->v_type = type;
Karsten Hopp 81c285
!     if (type != VAR_NUMBER)
Karsten Hopp 81c285
  	rettv->vval.v_string = NULL;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (check_restricted() || check_secure())
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 13770,13776 ****
Karsten Hopp 81c285
      typval_T	*argvars;
Karsten Hopp 81c285
      typval_T	*rettv;
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #ifdef FEAT_INS_EXPAND
Karsten Hopp 81c285
      if (pum_visible())
Karsten Hopp 81c285
  	rettv->vval.v_number = 1;
Karsten Hopp 81c285
--- 13738,13743 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 13804,13810 ****
Karsten Hopp 81c285
  	    stride = get_tv_number_chk(&argvars[2], &error);
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (error)
Karsten Hopp 81c285
  	return;		/* type error; errmsg already given */
Karsten Hopp 81c285
      if (stride == 0)
Karsten Hopp 81c285
--- 13771,13776 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 14193,14199 ****
Karsten Hopp 81c285
      typval_T	*argvars;
Karsten Hopp 81c285
      typval_T	*rettv;
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
  #ifdef FEAT_CLIENTSERVER
Karsten Hopp 81c285
  # ifdef WIN32
Karsten Hopp 81c285
      /* On Win32 it's done in this application. */
Karsten Hopp 81c285
--- 14159,14164 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 14249,14255 ****
Karsten Hopp 81c285
  	rettv->vval.v_number = (s != NULL);
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  # else
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (check_connection() == FAIL)
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 14214,14219 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 14338,14344 ****
Karsten Hopp 81c285
      dict_T	*d;
Karsten Hopp 81c285
      dictitem_T	*di;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type == VAR_DICT)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	if (argvars[2].v_type != VAR_UNKNOWN)
Karsten Hopp 81c285
--- 14302,14307 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 14696,14702 ****
Karsten Hopp 81c285
      list_T	*l;
Karsten Hopp 81c285
      listitem_T	*li, *ni;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type != VAR_LIST)
Karsten Hopp 81c285
  	EMSG2(_(e_listarg), "reverse()");
Karsten Hopp 81c285
      else if ((l = argvars[0].vval.v_list) != NULL
Karsten Hopp 81c285
--- 14659,14664 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 15048,15055 ****
Karsten Hopp 81c285
      int		lnum = 0;
Karsten Hopp 81c285
      int		col = 0;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
- 
Karsten Hopp 81c285
      if (rettv_list_alloc(rettv) == FAIL)
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 15010,15015 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 15236,15243 ****
Karsten Hopp 81c285
      int		n;
Karsten Hopp 81c285
      int		flags = 0;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
- 
Karsten Hopp 81c285
      if (rettv_list_alloc(rettv) == FAIL)
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 15196,15201 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 15323,15330 ****
Karsten Hopp 81c285
      typval_T	*varp;
Karsten Hopp 81c285
      char_u	nbuf[NUMBUFLEN];
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
- 
Karsten Hopp 81c285
      if (check_restricted() || check_secure())
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
      (void)get_tv_number(&argvars[0]);	    /* issue errmsg if type error */
Karsten Hopp 81c285
--- 15281,15286 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 15404,15410 ****
Karsten Hopp 81c285
      else
Karsten Hopp 81c285
  	line = get_tv_string_chk(&argvars[1]);
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     rettv->vval.v_number = 0;		/* OK */
Karsten Hopp 81c285
      for (;;)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	if (l != NULL)
Karsten Hopp 81c285
--- 15360,15366 ----
Karsten Hopp 81c285
      else
Karsten Hopp 81c285
  	line = get_tv_string_chk(&argvars[1]);
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     /* default result is zero == OK */
Karsten Hopp 81c285
      for (;;)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	if (l != NULL)
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 15717,15722 ****
Karsten Hopp 81c285
--- 15673,15679 ----
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
   * "setwinvar()" and "settabwinvar()" functions
Karsten Hopp 81c285
   */
Karsten Hopp 81c285
+ /*ARGSUSED*/
Karsten Hopp 81c285
      static void
Karsten Hopp 81c285
  setwinvar(argvars, rettv, off)
Karsten Hopp 81c285
      typval_T	*argvars;
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 15733,15740 ****
Karsten Hopp 81c285
      char_u	nbuf[NUMBUFLEN];
Karsten Hopp 81c285
      tabpage_T	*tp;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
- 
Karsten Hopp 81c285
      if (check_restricted() || check_secure())
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 15690,15695 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 15947,15953 ****
Karsten Hopp 81c285
      long	len;
Karsten Hopp 81c285
      long	i;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
-     rettv->vval.v_number = 0;
Karsten Hopp 81c285
      if (argvars[0].v_type != VAR_LIST)
Karsten Hopp 81c285
  	EMSG2(_(e_listarg), "sort()");
Karsten Hopp 81c285
      else
Karsten Hopp 81c285
--- 15902,15907 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 16870,16878 ****
Karsten Hopp 81c285
      typval_T	*argvars;
Karsten Hopp 81c285
      typval_T	*rettv;
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
! #ifndef FEAT_WINDOWS
Karsten Hopp 81c285
!     rettv->vval.v_number = 0;
Karsten Hopp 81c285
! #else
Karsten Hopp 81c285
      tabpage_T	*tp;
Karsten Hopp 81c285
      win_T	*wp = NULL;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 16824,16830 ----
Karsten Hopp 81c285
      typval_T	*argvars;
Karsten Hopp 81c285
      typval_T	*rettv;
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
! #ifdef FEAT_WINDOWS
Karsten Hopp 81c285
      tabpage_T	*tp;
Karsten Hopp 81c285
      win_T	*wp = NULL;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 16884,16902 ****
Karsten Hopp 81c285
  	if (tp != NULL)
Karsten Hopp 81c285
  	    wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
!     if (wp == NULL)
Karsten Hopp 81c285
! 	rettv->vval.v_number = 0;
Karsten Hopp 81c285
!     else
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
! 	if (rettv_list_alloc(rettv) == FAIL)
Karsten Hopp 81c285
! 	    rettv->vval.v_number = 0;
Karsten Hopp 81c285
! 	else
Karsten Hopp 81c285
! 	{
Karsten Hopp 81c285
! 	    for (; wp != NULL; wp = wp->w_next)
Karsten Hopp 81c285
! 		if (list_append_number(rettv->vval.v_list,
Karsten Hopp 81c285
  						wp->w_buffer->b_fnum) == FAIL)
Karsten Hopp 81c285
! 		    break;
Karsten Hopp 81c285
! 	}
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
--- 16836,16847 ----
Karsten Hopp 81c285
  	if (tp != NULL)
Karsten Hopp 81c285
  	    wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
!     if (wp != NULL && rettv_list_alloc(rettv) != FAIL)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
! 	for (; wp != NULL; wp = wp->w_next)
Karsten Hopp 81c285
! 	    if (list_append_number(rettv->vval.v_list,
Karsten Hopp 81c285
  						wp->w_buffer->b_fnum) == FAIL)
Karsten Hopp 81c285
! 		break;
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 17024,17033 ****
Karsten Hopp 81c285
      int		first;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (rettv_list_alloc(rettv) == FAIL)
Karsten Hopp 81c285
-     {
Karsten Hopp 81c285
- 	rettv->vval.v_number = 0;
Karsten Hopp 81c285
  	return;
Karsten Hopp 81c285
-     }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      for (first = TRUE; ; first = FALSE)
Karsten Hopp 81c285
  	if (get_tagfname(&tn, first, fname) == FAIL
Karsten Hopp 81c285
--- 16969,16975 ----
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 17401,17408 ****
Karsten Hopp 81c285
      /* A non-zero number or non-empty string argument: reset mode. */
Karsten Hopp 81c285
      if (non_zero_arg(&argvars[0]))
Karsten Hopp 81c285
  	curbuf->b_visual_mode_eval = NUL;
Karsten Hopp 81c285
- #else
Karsten Hopp 81c285
-     rettv->vval.v_number = 0; /* return anything, it won't work anyway */
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 17343,17348 ----
Karsten Hopp 81c285
*** ../vim-7.2.148/src/version.c	Wed Mar 18 19:07:09 2009
Karsten Hopp 81c285
--- src/version.c	Wed Apr 22 12:44:05 2009
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 678,679 ****
Karsten Hopp 81c285
--- 678,681 ----
Karsten Hopp 81c285
  {   /* Add new patch number below this line */
Karsten Hopp 81c285
+ /**/
Karsten Hopp 81c285
+     149,
Karsten Hopp 81c285
  /**/
Karsten Hopp 81c285
Karsten Hopp 81c285
Karsten Hopp 81c285
-- 
Karsten Hopp 81c285
WOMAN:   Well, 'ow did you become king then?
Karsten Hopp 81c285
ARTHUR:  The Lady of the Lake, [angels sing] her arm clad in the purest
Karsten Hopp 81c285
         shimmering samite, held aloft Excalibur from the bosom of the water
Karsten Hopp 81c285
         signifying by Divine Providence that I, Arthur, was to carry
Karsten Hopp 81c285
         Excalibur.  [singing stops] That is why I am your king!
Karsten Hopp 81c285
                                  The Quest for the Holy Grail (Monty Python)
Karsten Hopp 81c285
Karsten Hopp 81c285
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 81c285
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 81c285
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 81c285
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///