48ab2cf
To: vim_dev@googlegroups.com
48ab2cf
Subject: Patch 7.3.056
48ab2cf
Fcc: outbox
48ab2cf
From: Bram Moolenaar <Bram@moolenaar.net>
48ab2cf
Mime-Version: 1.0
48ab2cf
Content-Type: text/plain; charset=UTF-8
48ab2cf
Content-Transfer-Encoding: 8bit
48ab2cf
------------
48ab2cf
48ab2cf
Patch 7.3.056
48ab2cf
Problem:    "getline" argument in do_cmdline() shadows global.
48ab2cf
Solution:   Rename the argument.
48ab2cf
Files:	    src/ex_docmd.c
48ab2cf
48ab2cf
48ab2cf
*** ../vim-7.3.055/src/ex_docmd.c	2010-11-10 18:59:50.000000000 +0100
48ab2cf
--- src/ex_docmd.c	2010-11-16 11:24:40.000000000 +0100
48ab2cf
***************
48ab2cf
*** 733,739 ****
48ab2cf
   * do_cmdline(): execute one Ex command line
48ab2cf
   *
48ab2cf
   * 1. Execute "cmdline" when it is not NULL.
48ab2cf
!  *    If "cmdline" is NULL, or more lines are needed, getline() is used.
48ab2cf
   * 2. Split up in parts separated with '|'.
48ab2cf
   *
48ab2cf
   * This function can be called recursively!
48ab2cf
--- 733,739 ----
48ab2cf
   * do_cmdline(): execute one Ex command line
48ab2cf
   *
48ab2cf
   * 1. Execute "cmdline" when it is not NULL.
48ab2cf
!  *    If "cmdline" is NULL, or more lines are needed, fgetline() is used.
48ab2cf
   * 2. Split up in parts separated with '|'.
48ab2cf
   *
48ab2cf
   * This function can be called recursively!
48ab2cf
***************
48ab2cf
*** 741,747 ****
48ab2cf
   * flags:
48ab2cf
   * DOCMD_VERBOSE  - The command will be included in the error message.
48ab2cf
   * DOCMD_NOWAIT   - Don't call wait_return() and friends.
48ab2cf
!  * DOCMD_REPEAT   - Repeat execution until getline() returns NULL.
48ab2cf
   * DOCMD_KEYTYPED - Don't reset KeyTyped.
48ab2cf
   * DOCMD_EXCRESET - Reset the exception environment (used for debugging).
48ab2cf
   * DOCMD_KEEPLINE - Store first typed line (for repeating with ".").
48ab2cf
--- 741,747 ----
48ab2cf
   * flags:
48ab2cf
   * DOCMD_VERBOSE  - The command will be included in the error message.
48ab2cf
   * DOCMD_NOWAIT   - Don't call wait_return() and friends.
48ab2cf
!  * DOCMD_REPEAT   - Repeat execution until fgetline() returns NULL.
48ab2cf
   * DOCMD_KEYTYPED - Don't reset KeyTyped.
48ab2cf
   * DOCMD_EXCRESET - Reset the exception environment (used for debugging).
48ab2cf
   * DOCMD_KEEPLINE - Store first typed line (for repeating with ".").
48ab2cf
***************
48ab2cf
*** 749,763 ****
48ab2cf
   * return FAIL if cmdline could not be executed, OK otherwise
48ab2cf
   */
48ab2cf
      int
48ab2cf
! do_cmdline(cmdline, getline, cookie, flags)
48ab2cf
      char_u	*cmdline;
48ab2cf
!     char_u	*(*getline) __ARGS((int, void *, int));
48ab2cf
!     void	*cookie;		/* argument for getline() */
48ab2cf
      int		flags;
48ab2cf
  {
48ab2cf
      char_u	*next_cmdline;		/* next cmd to execute */
48ab2cf
      char_u	*cmdline_copy = NULL;	/* copy of cmd line */
48ab2cf
!     int		used_getline = FALSE;	/* used "getline" to obtain command */
48ab2cf
      static int	recursive = 0;		/* recursive depth */
48ab2cf
      int		msg_didout_before_start = 0;
48ab2cf
      int		count = 0;		/* line number count */
48ab2cf
--- 749,763 ----
48ab2cf
   * return FAIL if cmdline could not be executed, OK otherwise
48ab2cf
   */
48ab2cf
      int
48ab2cf
! do_cmdline(cmdline, fgetline, cookie, flags)
48ab2cf
      char_u	*cmdline;
48ab2cf
!     char_u	*(*fgetline) __ARGS((int, void *, int));
48ab2cf
!     void	*cookie;		/* argument for fgetline() */
48ab2cf
      int		flags;
48ab2cf
  {
48ab2cf
      char_u	*next_cmdline;		/* next cmd to execute */
48ab2cf
      char_u	*cmdline_copy = NULL;	/* copy of cmd line */
48ab2cf
!     int		used_getline = FALSE;	/* used "fgetline" to obtain command */
48ab2cf
      static int	recursive = 0;		/* recursive depth */
48ab2cf
      int		msg_didout_before_start = 0;
48ab2cf
      int		count = 0;		/* line number count */
48ab2cf
***************
48ab2cf
*** 775,788 ****
48ab2cf
      struct msglist	**saved_msg_list = NULL;
48ab2cf
      struct msglist	*private_msg_list;
48ab2cf
  
48ab2cf
!     /* "getline" and "cookie" passed to do_one_cmd() */
48ab2cf
      char_u	*(*cmd_getline) __ARGS((int, void *, int));
48ab2cf
      void	*cmd_cookie;
48ab2cf
      struct loop_cookie cmd_loop_cookie;
48ab2cf
      void	*real_cookie;
48ab2cf
      int		getline_is_func;
48ab2cf
  #else
48ab2cf
! # define cmd_getline getline
48ab2cf
  # define cmd_cookie cookie
48ab2cf
  #endif
48ab2cf
      static int	call_depth = 0;		/* recursiveness */
48ab2cf
--- 775,788 ----
48ab2cf
      struct msglist	**saved_msg_list = NULL;
48ab2cf
      struct msglist	*private_msg_list;
48ab2cf
  
48ab2cf
!     /* "fgetline" and "cookie" passed to do_one_cmd() */
48ab2cf
      char_u	*(*cmd_getline) __ARGS((int, void *, int));
48ab2cf
      void	*cmd_cookie;
48ab2cf
      struct loop_cookie cmd_loop_cookie;
48ab2cf
      void	*real_cookie;
48ab2cf
      int		getline_is_func;
48ab2cf
  #else
48ab2cf
! # define cmd_getline fgetline
48ab2cf
  # define cmd_cookie cookie
48ab2cf
  #endif
48ab2cf
      static int	call_depth = 0;		/* recursiveness */
48ab2cf
***************
48ab2cf
*** 822,831 ****
48ab2cf
      cstack.cs_lflags = 0;
48ab2cf
      ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10);
48ab2cf
  
48ab2cf
!     real_cookie = getline_cookie(getline, cookie);
48ab2cf
  
48ab2cf
      /* Inside a function use a higher nesting level. */
48ab2cf
!     getline_is_func = getline_equal(getline, cookie, get_func_line);
48ab2cf
      if (getline_is_func && ex_nesting_level == func_level(real_cookie))
48ab2cf
  	++ex_nesting_level;
48ab2cf
  
48ab2cf
--- 822,831 ----
48ab2cf
      cstack.cs_lflags = 0;
48ab2cf
      ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10);
48ab2cf
  
48ab2cf
!     real_cookie = getline_cookie(fgetline, cookie);
48ab2cf
  
48ab2cf
      /* Inside a function use a higher nesting level. */
48ab2cf
!     getline_is_func = getline_equal(fgetline, cookie, get_func_line);
48ab2cf
      if (getline_is_func && ex_nesting_level == func_level(real_cookie))
48ab2cf
  	++ex_nesting_level;
48ab2cf
  
48ab2cf
***************
48ab2cf
*** 837,843 ****
48ab2cf
  	breakpoint = func_breakpoint(real_cookie);
48ab2cf
  	dbg_tick = func_dbg_tick(real_cookie);
48ab2cf
      }
48ab2cf
!     else if (getline_equal(getline, cookie, getsourceline))
48ab2cf
      {
48ab2cf
  	fname = sourcing_name;
48ab2cf
  	breakpoint = source_breakpoint(real_cookie);
48ab2cf
--- 837,843 ----
48ab2cf
  	breakpoint = func_breakpoint(real_cookie);
48ab2cf
  	dbg_tick = func_dbg_tick(real_cookie);
48ab2cf
      }
48ab2cf
!     else if (getline_equal(fgetline, cookie, getsourceline))
48ab2cf
      {
48ab2cf
  	fname = sourcing_name;
48ab2cf
  	breakpoint = source_breakpoint(real_cookie);
48ab2cf
***************
48ab2cf
*** 881,887 ****
48ab2cf
       * KeyTyped is only set when calling vgetc().  Reset it here when not
48ab2cf
       * calling vgetc() (sourced command lines).
48ab2cf
       */
48ab2cf
!     if (!(flags & DOCMD_KEYTYPED) && !getline_equal(getline, cookie, getexline))
48ab2cf
  	KeyTyped = FALSE;
48ab2cf
  
48ab2cf
      /*
48ab2cf
--- 881,888 ----
48ab2cf
       * KeyTyped is only set when calling vgetc().  Reset it here when not
48ab2cf
       * calling vgetc() (sourced command lines).
48ab2cf
       */
48ab2cf
!     if (!(flags & DOCMD_KEYTYPED)
48ab2cf
! 			       && !getline_equal(fgetline, cookie, getexline))
48ab2cf
  	KeyTyped = FALSE;
48ab2cf
  
48ab2cf
      /*
48ab2cf
***************
48ab2cf
*** 894,900 ****
48ab2cf
      do
48ab2cf
      {
48ab2cf
  #ifdef FEAT_EVAL
48ab2cf
! 	getline_is_func = getline_equal(getline, cookie, get_func_line);
48ab2cf
  #endif
48ab2cf
  
48ab2cf
  	/* stop skipping cmds for an error msg after all endif/while/for */
48ab2cf
--- 895,901 ----
48ab2cf
      do
48ab2cf
      {
48ab2cf
  #ifdef FEAT_EVAL
48ab2cf
! 	getline_is_func = getline_equal(fgetline, cookie, get_func_line);
48ab2cf
  #endif
48ab2cf
  
48ab2cf
  	/* stop skipping cmds for an error msg after all endif/while/for */
48ab2cf
***************
48ab2cf
*** 909,915 ****
48ab2cf
  
48ab2cf
  	/*
48ab2cf
  	 * 1. If repeating a line in a loop, get a line from lines_ga.
48ab2cf
! 	 * 2. If no line given: Get an allocated line with getline().
48ab2cf
  	 * 3. If a line is given: Make a copy, so we can mess with it.
48ab2cf
  	 */
48ab2cf
  
48ab2cf
--- 910,916 ----
48ab2cf
  
48ab2cf
  	/*
48ab2cf
  	 * 1. If repeating a line in a loop, get a line from lines_ga.
48ab2cf
! 	 * 2. If no line given: Get an allocated line with fgetline().
48ab2cf
  	 * 3. If a line is given: Make a copy, so we can mess with it.
48ab2cf
  	 */
48ab2cf
  
48ab2cf
***************
48ab2cf
*** 938,949 ****
48ab2cf
  	    }
48ab2cf
  #ifdef FEAT_PROFILE
48ab2cf
  	    else if (do_profiling == PROF_YES
48ab2cf
! 			     && getline_equal(getline, cookie, getsourceline))
48ab2cf
  		script_line_end();
48ab2cf
  #endif
48ab2cf
  
48ab2cf
  	    /* Check if a sourced file hit a ":finish" command. */
48ab2cf
! 	    if (source_finished(getline, cookie))
48ab2cf
  	    {
48ab2cf
  		retval = FAIL;
48ab2cf
  		break;
48ab2cf
--- 939,950 ----
48ab2cf
  	    }
48ab2cf
  #ifdef FEAT_PROFILE
48ab2cf
  	    else if (do_profiling == PROF_YES
48ab2cf
! 			    && getline_equal(fgetline, cookie, getsourceline))
48ab2cf
  		script_line_end();
48ab2cf
  #endif
48ab2cf
  
48ab2cf
  	    /* Check if a sourced file hit a ":finish" command. */
48ab2cf
! 	    if (source_finished(fgetline, cookie))
48ab2cf
  	    {
48ab2cf
  		retval = FAIL;
48ab2cf
  		break;
48ab2cf
***************
48ab2cf
*** 954,960 ****
48ab2cf
  						   && *dbg_tick != debug_tick)
48ab2cf
  	    {
48ab2cf
  		*breakpoint = dbg_find_breakpoint(
48ab2cf
! 				getline_equal(getline, cookie, getsourceline),
48ab2cf
  							fname, sourcing_lnum);
48ab2cf
  		*dbg_tick = debug_tick;
48ab2cf
  	    }
48ab2cf
--- 955,961 ----
48ab2cf
  						   && *dbg_tick != debug_tick)
48ab2cf
  	    {
48ab2cf
  		*breakpoint = dbg_find_breakpoint(
48ab2cf
! 				getline_equal(fgetline, cookie, getsourceline),
48ab2cf
  							fname, sourcing_lnum);
48ab2cf
  		*dbg_tick = debug_tick;
48ab2cf
  	    }
48ab2cf
***************
48ab2cf
*** 969,975 ****
48ab2cf
  		dbg_breakpoint(fname, sourcing_lnum);
48ab2cf
  		/* Find next breakpoint. */
48ab2cf
  		*breakpoint = dbg_find_breakpoint(
48ab2cf
! 				getline_equal(getline, cookie, getsourceline),
48ab2cf
  							fname, sourcing_lnum);
48ab2cf
  		*dbg_tick = debug_tick;
48ab2cf
  	    }
48ab2cf
--- 970,976 ----
48ab2cf
  		dbg_breakpoint(fname, sourcing_lnum);
48ab2cf
  		/* Find next breakpoint. */
48ab2cf
  		*breakpoint = dbg_find_breakpoint(
48ab2cf
! 			       getline_equal(fgetline, cookie, getsourceline),
48ab2cf
  							fname, sourcing_lnum);
48ab2cf
  		*dbg_tick = debug_tick;
48ab2cf
  	    }
48ab2cf
***************
48ab2cf
*** 978,984 ****
48ab2cf
  	    {
48ab2cf
  		if (getline_is_func)
48ab2cf
  		    func_line_start(real_cookie);
48ab2cf
! 		else if (getline_equal(getline, cookie, getsourceline))
48ab2cf
  		    script_line_start();
48ab2cf
  	    }
48ab2cf
  # endif
48ab2cf
--- 979,985 ----
48ab2cf
  	    {
48ab2cf
  		if (getline_is_func)
48ab2cf
  		    func_line_start(real_cookie);
48ab2cf
! 		else if (getline_equal(fgetline, cookie, getsourceline))
48ab2cf
  		    script_line_start();
48ab2cf
  	    }
48ab2cf
  # endif
48ab2cf
***************
48ab2cf
*** 987,993 ****
48ab2cf
  	if (cstack.cs_looplevel > 0)
48ab2cf
  	{
48ab2cf
  	    /* Inside a while/for loop we need to store the lines and use them
48ab2cf
! 	     * again.  Pass a different "getline" function to do_one_cmd()
48ab2cf
  	     * below, so that it stores lines in or reads them from
48ab2cf
  	     * "lines_ga".  Makes it possible to define a function inside a
48ab2cf
  	     * while/for loop. */
48ab2cf
--- 988,994 ----
48ab2cf
  	if (cstack.cs_looplevel > 0)
48ab2cf
  	{
48ab2cf
  	    /* Inside a while/for loop we need to store the lines and use them
48ab2cf
! 	     * again.  Pass a different "fgetline" function to do_one_cmd()
48ab2cf
  	     * below, so that it stores lines in or reads them from
48ab2cf
  	     * "lines_ga".  Makes it possible to define a function inside a
48ab2cf
  	     * while/for loop. */
48ab2cf
***************
48ab2cf
*** 995,1021 ****
48ab2cf
  	    cmd_cookie = (void *)&cmd_loop_cookie;
48ab2cf
  	    cmd_loop_cookie.lines_gap = &lines_ga;
48ab2cf
  	    cmd_loop_cookie.current_line = current_line;
48ab2cf
! 	    cmd_loop_cookie.getline = getline;
48ab2cf
  	    cmd_loop_cookie.cookie = cookie;
48ab2cf
  	    cmd_loop_cookie.repeating = (current_line < lines_ga.ga_len);
48ab2cf
  	}
48ab2cf
  	else
48ab2cf
  	{
48ab2cf
! 	    cmd_getline = getline;
48ab2cf
  	    cmd_cookie = cookie;
48ab2cf
  	}
48ab2cf
  #endif
48ab2cf
  
48ab2cf
! 	/* 2. If no line given, get an allocated line with getline(). */
48ab2cf
  	if (next_cmdline == NULL)
48ab2cf
  	{
48ab2cf
  	    /*
48ab2cf
  	     * Need to set msg_didout for the first line after an ":if",
48ab2cf
  	     * otherwise the ":if" will be overwritten.
48ab2cf
  	     */
48ab2cf
! 	    if (count == 1 && getline_equal(getline, cookie, getexline))
48ab2cf
  		msg_didout = TRUE;
48ab2cf
! 	    if (getline == NULL || (next_cmdline = getline(':', cookie,
48ab2cf
  #ifdef FEAT_EVAL
48ab2cf
  		    cstack.cs_idx < 0 ? 0 : (cstack.cs_idx + 1) * 2
48ab2cf
  #else
48ab2cf
--- 996,1022 ----
48ab2cf
  	    cmd_cookie = (void *)&cmd_loop_cookie;
48ab2cf
  	    cmd_loop_cookie.lines_gap = &lines_ga;
48ab2cf
  	    cmd_loop_cookie.current_line = current_line;
48ab2cf
! 	    cmd_loop_cookie.getline = fgetline;
48ab2cf
  	    cmd_loop_cookie.cookie = cookie;
48ab2cf
  	    cmd_loop_cookie.repeating = (current_line < lines_ga.ga_len);
48ab2cf
  	}
48ab2cf
  	else
48ab2cf
  	{
48ab2cf
! 	    cmd_getline = fgetline;
48ab2cf
  	    cmd_cookie = cookie;
48ab2cf
  	}
48ab2cf
  #endif
48ab2cf
  
48ab2cf
! 	/* 2. If no line given, get an allocated line with fgetline(). */
48ab2cf
  	if (next_cmdline == NULL)
48ab2cf
  	{
48ab2cf
  	    /*
48ab2cf
  	     * Need to set msg_didout for the first line after an ":if",
48ab2cf
  	     * otherwise the ":if" will be overwritten.
48ab2cf
  	     */
48ab2cf
! 	    if (count == 1 && getline_equal(fgetline, cookie, getexline))
48ab2cf
  		msg_didout = TRUE;
48ab2cf
! 	    if (fgetline == NULL || (next_cmdline = fgetline(':', cookie,
48ab2cf
  #ifdef FEAT_EVAL
48ab2cf
  		    cstack.cs_idx < 0 ? 0 : (cstack.cs_idx + 1) * 2
48ab2cf
  #else
48ab2cf
***************
48ab2cf
*** 1142,1148 ****
48ab2cf
  	     * If the command was typed, remember it for the ':' register.
48ab2cf
  	     * Do this AFTER executing the command to make :@: work.
48ab2cf
  	     */
48ab2cf
! 	    if (getline_equal(getline, cookie, getexline)
48ab2cf
  						  && new_last_cmdline != NULL)
48ab2cf
  	    {
48ab2cf
  		vim_free(last_cmdline);
48ab2cf
--- 1143,1149 ----
48ab2cf
  	     * If the command was typed, remember it for the ':' register.
48ab2cf
  	     * Do this AFTER executing the command to make :@: work.
48ab2cf
  	     */
48ab2cf
! 	    if (getline_equal(fgetline, cookie, getexline)
48ab2cf
  						  && new_last_cmdline != NULL)
48ab2cf
  	    {
48ab2cf
  		vim_free(last_cmdline);
48ab2cf
***************
48ab2cf
*** 1163,1169 ****
48ab2cf
  #ifdef FEAT_EVAL
48ab2cf
  	/* reset did_emsg for a function that is not aborted by an error */
48ab2cf
  	if (did_emsg && !force_abort
48ab2cf
! 		&& getline_equal(getline, cookie, get_func_line)
48ab2cf
  					      && !func_has_abort(real_cookie))
48ab2cf
  	    did_emsg = FALSE;
48ab2cf
  
48ab2cf
--- 1164,1170 ----
48ab2cf
  #ifdef FEAT_EVAL
48ab2cf
  	/* reset did_emsg for a function that is not aborted by an error */
48ab2cf
  	if (did_emsg && !force_abort
48ab2cf
! 		&& getline_equal(fgetline, cookie, get_func_line)
48ab2cf
  					      && !func_has_abort(real_cookie))
48ab2cf
  	    did_emsg = FALSE;
48ab2cf
  
48ab2cf
***************
48ab2cf
*** 1202,1208 ****
48ab2cf
  		    if (breakpoint != NULL)
48ab2cf
  		    {
48ab2cf
  			*breakpoint = dbg_find_breakpoint(
48ab2cf
! 				getline_equal(getline, cookie, getsourceline),
48ab2cf
  									fname,
48ab2cf
  			   ((wcmd_T *)lines_ga.ga_data)[current_line].lnum-1);
48ab2cf
  			*dbg_tick = debug_tick;
48ab2cf
--- 1203,1209 ----
48ab2cf
  		    if (breakpoint != NULL)
48ab2cf
  		    {
48ab2cf
  			*breakpoint = dbg_find_breakpoint(
48ab2cf
! 			       getline_equal(fgetline, cookie, getsourceline),
48ab2cf
  									fname,
48ab2cf
  			   ((wcmd_T *)lines_ga.ga_data)[current_line].lnum-1);
48ab2cf
  			*dbg_tick = debug_tick;
48ab2cf
***************
48ab2cf
*** 1296,1303 ****
48ab2cf
  #endif
48ab2cf
  	    )
48ab2cf
  	    && !(did_emsg && used_getline
48ab2cf
! 			  && (getline_equal(getline, cookie, getexmodeline)
48ab2cf
! 				|| getline_equal(getline, cookie, getexline)))
48ab2cf
  	    && (next_cmdline != NULL
48ab2cf
  #ifdef FEAT_EVAL
48ab2cf
  			|| cstack.cs_idx >= 0
48ab2cf
--- 1297,1304 ----
48ab2cf
  #endif
48ab2cf
  	    )
48ab2cf
  	    && !(did_emsg && used_getline
48ab2cf
! 			    && (getline_equal(fgetline, cookie, getexmodeline)
48ab2cf
! 			       || getline_equal(fgetline, cookie, getexline)))
48ab2cf
  	    && (next_cmdline != NULL
48ab2cf
  #ifdef FEAT_EVAL
48ab2cf
  			|| cstack.cs_idx >= 0
48ab2cf
***************
48ab2cf
*** 1316,1324 ****
48ab2cf
  	 * unclosed conditional.
48ab2cf
  	 */
48ab2cf
  	if (!got_int && !did_throw
48ab2cf
! 		&& ((getline_equal(getline, cookie, getsourceline)
48ab2cf
! 			&& !source_finished(getline, cookie))
48ab2cf
! 		    || (getline_equal(getline, cookie, get_func_line)
48ab2cf
  					    && !func_has_ended(real_cookie))))
48ab2cf
  	{
48ab2cf
  	    if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY)
48ab2cf
--- 1317,1325 ----
48ab2cf
  	 * unclosed conditional.
48ab2cf
  	 */
48ab2cf
  	if (!got_int && !did_throw
48ab2cf
! 		&& ((getline_equal(fgetline, cookie, getsourceline)
48ab2cf
! 			&& !source_finished(fgetline, cookie))
48ab2cf
! 		    || (getline_equal(fgetline, cookie, get_func_line)
48ab2cf
  					    && !func_has_ended(real_cookie))))
48ab2cf
  	{
48ab2cf
  	    if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY)
48ab2cf
***************
48ab2cf
*** 1354,1360 ****
48ab2cf
      /* If a missing ":endtry", ":endwhile", ":endfor", or ":endif" or a memory
48ab2cf
       * lack was reported above and the error message is to be converted to an
48ab2cf
       * exception, do this now after rewinding the cstack. */
48ab2cf
!     do_errthrow(&cstack, getline_equal(getline, cookie, get_func_line)
48ab2cf
  				  ? (char_u *)"endfunction" : (char_u *)NULL);
48ab2cf
  
48ab2cf
      if (trylevel == 0)
48ab2cf
--- 1355,1361 ----
48ab2cf
      /* If a missing ":endtry", ":endwhile", ":endfor", or ":endif" or a memory
48ab2cf
       * lack was reported above and the error message is to be converted to an
48ab2cf
       * exception, do this now after rewinding the cstack. */
48ab2cf
!     do_errthrow(&cstack, getline_equal(fgetline, cookie, get_func_line)
48ab2cf
  				  ? (char_u *)"endfunction" : (char_u *)NULL);
48ab2cf
  
48ab2cf
      if (trylevel == 0)
48ab2cf
***************
48ab2cf
*** 1449,1457 ****
48ab2cf
       */
48ab2cf
      if (did_throw)
48ab2cf
  	need_rethrow = TRUE;
48ab2cf
!     if ((getline_equal(getline, cookie, getsourceline)
48ab2cf
  		&& ex_nesting_level > source_level(real_cookie))
48ab2cf
! 	    || (getline_equal(getline, cookie, get_func_line)
48ab2cf
  		&& ex_nesting_level > func_level(real_cookie) + 1))
48ab2cf
      {
48ab2cf
  	if (!did_throw)
48ab2cf
--- 1450,1458 ----
48ab2cf
       */
48ab2cf
      if (did_throw)
48ab2cf
  	need_rethrow = TRUE;
48ab2cf
!     if ((getline_equal(fgetline, cookie, getsourceline)
48ab2cf
  		&& ex_nesting_level > source_level(real_cookie))
48ab2cf
! 	    || (getline_equal(fgetline, cookie, get_func_line)
48ab2cf
  		&& ex_nesting_level > func_level(real_cookie) + 1))
48ab2cf
      {
48ab2cf
  	if (!did_throw)
48ab2cf
***************
48ab2cf
*** 1460,1475 ****
48ab2cf
      else
48ab2cf
      {
48ab2cf
  	/* When leaving a function, reduce nesting level. */
48ab2cf
! 	if (getline_equal(getline, cookie, get_func_line))
48ab2cf
  	    --ex_nesting_level;
48ab2cf
  	/*
48ab2cf
  	 * Go to debug mode when returning from a function in which we are
48ab2cf
  	 * single-stepping.
48ab2cf
  	 */
48ab2cf
! 	if ((getline_equal(getline, cookie, getsourceline)
48ab2cf
! 		    || getline_equal(getline, cookie, get_func_line))
48ab2cf
  		&& ex_nesting_level + 1 <= debug_break_level)
48ab2cf
! 	    do_debug(getline_equal(getline, cookie, getsourceline)
48ab2cf
  		    ? (char_u *)_("End of sourced file")
48ab2cf
  		    : (char_u *)_("End of function"));
48ab2cf
      }
48ab2cf
--- 1461,1476 ----
48ab2cf
      else
48ab2cf
      {
48ab2cf
  	/* When leaving a function, reduce nesting level. */
48ab2cf
! 	if (getline_equal(fgetline, cookie, get_func_line))
48ab2cf
  	    --ex_nesting_level;
48ab2cf
  	/*
48ab2cf
  	 * Go to debug mode when returning from a function in which we are
48ab2cf
  	 * single-stepping.
48ab2cf
  	 */
48ab2cf
! 	if ((getline_equal(fgetline, cookie, getsourceline)
48ab2cf
! 		    || getline_equal(fgetline, cookie, get_func_line))
48ab2cf
  		&& ex_nesting_level + 1 <= debug_break_level)
48ab2cf
! 	    do_debug(getline_equal(fgetline, cookie, getsourceline)
48ab2cf
  		    ? (char_u *)_("End of sourced file")
48ab2cf
  		    : (char_u *)_("End of function"));
48ab2cf
      }
48ab2cf
*** ../vim-7.3.055/src/version.c	2010-11-16 11:28:33.000000000 +0100
48ab2cf
--- src/version.c	2010-11-16 11:27:09.000000000 +0100
48ab2cf
***************
48ab2cf
*** 716,717 ****
48ab2cf
--- 716,719 ----
48ab2cf
  {   /* Add new patch number below this line */
48ab2cf
+ /**/
48ab2cf
+     56,
48ab2cf
  /**/
48ab2cf
48ab2cf
-- 
48ab2cf
Lawmakers made it obligatory for everybody to take at least one bath
48ab2cf
each week -- on Saturday night.
48ab2cf
		[real standing law in Vermont, United States of America]
48ab2cf
48ab2cf
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
48ab2cf
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
48ab2cf
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
48ab2cf
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///