Karsten Hopp 52df02
To: vim_dev@googlegroups.com
Karsten Hopp 52df02
Subject: Patch 7.3.401
Karsten Hopp 52df02
Fcc: outbox
Karsten Hopp 52df02
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 52df02
Mime-Version: 1.0
Karsten Hopp 52df02
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 52df02
Content-Transfer-Encoding: 8bit
Karsten Hopp 52df02
------------
Karsten Hopp 52df02
Karsten Hopp 52df02
Patch 7.3.401
Karsten Hopp 52df02
Problem:    A couple more shadowed variables.
Karsten Hopp 52df02
Solution:   Rename the variables.
Karsten Hopp 52df02
Files:	    src/netbeans.c
Karsten Hopp 52df02
Karsten Hopp 52df02
Karsten Hopp 52df02
*** ../vim-7.3.400/src/netbeans.c	2012-01-10 22:26:12.000000000 +0100
Karsten Hopp 52df02
--- src/netbeans.c	2012-01-10 22:30:17.000000000 +0100
Karsten Hopp 52df02
***************
Karsten Hopp 52df02
*** 443,449 ****
Karsten Hopp 52df02
      FILE *fp;
Karsten Hopp 52df02
      char_u buf[BUFSIZ];
Karsten Hopp 52df02
      char_u *lp;
Karsten Hopp 52df02
!     char_u *nl;
Karsten Hopp 52df02
  #ifdef UNIX
Karsten Hopp 52df02
      struct stat	st;
Karsten Hopp 52df02
  
Karsten Hopp 52df02
--- 443,449 ----
Karsten Hopp 52df02
      FILE *fp;
Karsten Hopp 52df02
      char_u buf[BUFSIZ];
Karsten Hopp 52df02
      char_u *lp;
Karsten Hopp 52df02
!     char_u *nlp;
Karsten Hopp 52df02
  #ifdef UNIX
Karsten Hopp 52df02
      struct stat	st;
Karsten Hopp 52df02
  
Karsten Hopp 52df02
***************
Karsten Hopp 52df02
*** 472,479 ****
Karsten Hopp 52df02
      /* Read the file. There should be one of each parameter */
Karsten Hopp 52df02
      while ((lp = (char_u *)fgets((char *)buf, BUFSIZ, fp)) != NULL)
Karsten Hopp 52df02
      {
Karsten Hopp 52df02
! 	if ((nl = vim_strchr(lp, '\n')) != NULL)
Karsten Hopp 52df02
! 	    *nl = 0;	    /* strip off the trailing newline */
Karsten Hopp 52df02
  
Karsten Hopp 52df02
  	if (STRNCMP(lp, "host=", 5) == 0)
Karsten Hopp 52df02
  	{
Karsten Hopp 52df02
--- 472,479 ----
Karsten Hopp 52df02
      /* Read the file. There should be one of each parameter */
Karsten Hopp 52df02
      while ((lp = (char_u *)fgets((char *)buf, BUFSIZ, fp)) != NULL)
Karsten Hopp 52df02
      {
Karsten Hopp 52df02
! 	if ((nlp = vim_strchr(lp, '\n')) != NULL)
Karsten Hopp 52df02
! 	    *nlp = 0;	    /* strip off the trailing newline */
Karsten Hopp 52df02
  
Karsten Hopp 52df02
  	if (STRNCMP(lp, "host=", 5) == 0)
Karsten Hopp 52df02
  	{
Karsten Hopp 52df02
***************
Karsten Hopp 52df02
*** 1740,1746 ****
Karsten Hopp 52df02
  		int	added = 0;
Karsten Hopp 52df02
  		int	oldFire = netbeansFireChanges;
Karsten Hopp 52df02
  		int	old_b_changed;
Karsten Hopp 52df02
! 		char_u	*nl;
Karsten Hopp 52df02
  		linenr_T lnum;
Karsten Hopp 52df02
  		linenr_T lnum_start;
Karsten Hopp 52df02
  		pos_T	*pos;
Karsten Hopp 52df02
--- 1740,1746 ----
Karsten Hopp 52df02
  		int	added = 0;
Karsten Hopp 52df02
  		int	oldFire = netbeansFireChanges;
Karsten Hopp 52df02
  		int	old_b_changed;
Karsten Hopp 52df02
! 		char_u	*nlp;
Karsten Hopp 52df02
  		linenr_T lnum;
Karsten Hopp 52df02
  		linenr_T lnum_start;
Karsten Hopp 52df02
  		pos_T	*pos;
Karsten Hopp 52df02
***************
Karsten Hopp 52df02
*** 1780,1787 ****
Karsten Hopp 52df02
  		do_update = 1;
Karsten Hopp 52df02
  		while (*args != NUL)
Karsten Hopp 52df02
  		{
Karsten Hopp 52df02
! 		    nl = vim_strchr(args, '\n');
Karsten Hopp 52df02
! 		    if (nl == NULL)
Karsten Hopp 52df02
  		    {
Karsten Hopp 52df02
  			/* Incomplete line, probably truncated.  Next "insert"
Karsten Hopp 52df02
  			 * command should append to this one. */
Karsten Hopp 52df02
--- 1780,1787 ----
Karsten Hopp 52df02
  		do_update = 1;
Karsten Hopp 52df02
  		while (*args != NUL)
Karsten Hopp 52df02
  		{
Karsten Hopp 52df02
! 		    nlp = vim_strchr(args, '\n');
Karsten Hopp 52df02
! 		    if (nlp == NULL)
Karsten Hopp 52df02
  		    {
Karsten Hopp 52df02
  			/* Incomplete line, probably truncated.  Next "insert"
Karsten Hopp 52df02
  			 * command should append to this one. */
Karsten Hopp 52df02
***************
Karsten Hopp 52df02
*** 1789,1801 ****
Karsten Hopp 52df02
  		    }
Karsten Hopp 52df02
  		    else
Karsten Hopp 52df02
  		    {
Karsten Hopp 52df02
! 			len = nl - args;
Karsten Hopp 52df02
  
Karsten Hopp 52df02
  			/*
Karsten Hopp 52df02
  			 * We need to detect EOL style, because the commands
Karsten Hopp 52df02
  			 * use a character offset.
Karsten Hopp 52df02
  			 */
Karsten Hopp 52df02
! 			if (nl > args && nl[-1] == '\r')
Karsten Hopp 52df02
  			{
Karsten Hopp 52df02
  			    ff_detected = EOL_DOS;
Karsten Hopp 52df02
  			    --len;
Karsten Hopp 52df02
--- 1789,1801 ----
Karsten Hopp 52df02
  		    }
Karsten Hopp 52df02
  		    else
Karsten Hopp 52df02
  		    {
Karsten Hopp 52df02
! 			len = nlp - args;
Karsten Hopp 52df02
  
Karsten Hopp 52df02
  			/*
Karsten Hopp 52df02
  			 * We need to detect EOL style, because the commands
Karsten Hopp 52df02
  			 * use a character offset.
Karsten Hopp 52df02
  			 */
Karsten Hopp 52df02
! 			if (nlp > args && nlp[-1] == '\r')
Karsten Hopp 52df02
  			{
Karsten Hopp 52df02
  			    ff_detected = EOL_DOS;
Karsten Hopp 52df02
  			    --len;
Karsten Hopp 52df02
***************
Karsten Hopp 52df02
*** 1814,1820 ****
Karsten Hopp 52df02
  
Karsten Hopp 52df02
  			/* Insert halfway a line.  For simplicity we assume we
Karsten Hopp 52df02
  			 * need to append to the line. */
Karsten Hopp 52df02
! 			newline = alloc_check((unsigned)(STRLEN(oldline) + len + 1));
Karsten Hopp 52df02
  			if (newline != NULL)
Karsten Hopp 52df02
  			{
Karsten Hopp 52df02
  			    STRCPY(newline, oldline);
Karsten Hopp 52df02
--- 1814,1821 ----
Karsten Hopp 52df02
  
Karsten Hopp 52df02
  			/* Insert halfway a line.  For simplicity we assume we
Karsten Hopp 52df02
  			 * need to append to the line. */
Karsten Hopp 52df02
! 			newline = alloc_check(
Karsten Hopp 52df02
! 				       (unsigned)(STRLEN(oldline) + len + 1));
Karsten Hopp 52df02
  			if (newline != NULL)
Karsten Hopp 52df02
  			{
Karsten Hopp 52df02
  			    STRCPY(newline, oldline);
Karsten Hopp 52df02
***************
Karsten Hopp 52df02
*** 1826,1839 ****
Karsten Hopp 52df02
  		    {
Karsten Hopp 52df02
  			/* Append a new line.  Not that we always do this,
Karsten Hopp 52df02
  			 * also when the text doesn't end in a "\n". */
Karsten Hopp 52df02
! 			ml_append((linenr_T)(lnum - 1), args, (colnr_T)(len + 1), FALSE);
Karsten Hopp 52df02
  			++added;
Karsten Hopp 52df02
  		    }
Karsten Hopp 52df02
  
Karsten Hopp 52df02
! 		    if (nl == NULL)
Karsten Hopp 52df02
  			break;
Karsten Hopp 52df02
  		    ++lnum;
Karsten Hopp 52df02
! 		    args = nl + 1;
Karsten Hopp 52df02
  		}
Karsten Hopp 52df02
  
Karsten Hopp 52df02
  		/* Adjust the marks below the inserted lines. */
Karsten Hopp 52df02
--- 1827,1841 ----
Karsten Hopp 52df02
  		    {
Karsten Hopp 52df02
  			/* Append a new line.  Not that we always do this,
Karsten Hopp 52df02
  			 * also when the text doesn't end in a "\n". */
Karsten Hopp 52df02
! 			ml_append((linenr_T)(lnum - 1), args,
Karsten Hopp 52df02
! 						   (colnr_T)(len + 1), FALSE);
Karsten Hopp 52df02
  			++added;
Karsten Hopp 52df02
  		    }
Karsten Hopp 52df02
  
Karsten Hopp 52df02
! 		    if (nlp == NULL)
Karsten Hopp 52df02
  			break;
Karsten Hopp 52df02
  		    ++lnum;
Karsten Hopp 52df02
! 		    args = nlp + 1;
Karsten Hopp 52df02
  		}
Karsten Hopp 52df02
  
Karsten Hopp 52df02
  		/* Adjust the marks below the inserted lines. */
Karsten Hopp 52df02
*** ../vim-7.3.400/src/version.c	2012-01-10 22:26:12.000000000 +0100
Karsten Hopp 52df02
--- src/version.c	2012-01-10 22:30:47.000000000 +0100
Karsten Hopp 52df02
***************
Karsten Hopp 52df02
*** 716,717 ****
Karsten Hopp 52df02
--- 716,719 ----
Karsten Hopp 52df02
  {   /* Add new patch number below this line */
Karsten Hopp 52df02
+ /**/
Karsten Hopp 52df02
+     401,
Karsten Hopp 52df02
  /**/
Karsten Hopp 52df02
Karsten Hopp 52df02
-- 
Karsten Hopp 52df02
So when I saw the post to comp.editors, I rushed over to the FTP site to
Karsten Hopp 52df02
grab it.  So I yank apart the tarball, light x candles, where x= the
Karsten Hopp 52df02
vim version multiplied by the md5sum of the source divided by the MAC of
Karsten Hopp 52df02
my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights,
Karsten Hopp 52df02
wave a dead chicken over the hard drive, and summon the power of GNU GCC
Karsten Hopp 52df02
with the magic words "make config ; make!".
Karsten Hopp 52df02
		[Jason Spence, compiling Vim 5.0]
Karsten Hopp 52df02
Karsten Hopp 52df02
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 52df02
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 52df02
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 52df02
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///