3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.451
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.451
3ef2ca
Problem:    Calling system() with empty input gives an error for writing the
3ef2ca
	    temp file.
3ef2ca
Solution:   Do not try writing if the string length is zero. (Olaf Dabrunz)
3ef2ca
Files:	    src/eval.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.450/src/eval.c	2014-09-19 14:26:29.654405000 +0200
3ef2ca
--- src/eval.c	2014-09-19 20:23:57.354451850 +0200
3ef2ca
***************
3ef2ca
*** 18638,18650 ****
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    p = get_tv_string_buf_chk(&argvars[1], buf);
3ef2ca
  	    if (p == NULL)
3ef2ca
  	    {
3ef2ca
  		fclose(fd);
3ef2ca
  		goto errret;		/* type error; errmsg already given */
3ef2ca
  	    }
3ef2ca
! 	    if (fwrite(p, STRLEN(p), 1, fd) != 1)
3ef2ca
  		err = TRUE;
3ef2ca
  	}
3ef2ca
  	if (fclose(fd) != 0)
3ef2ca
--- 18638,18653 ----
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
+ 	    size_t len;
3ef2ca
+ 
3ef2ca
  	    p = get_tv_string_buf_chk(&argvars[1], buf);
3ef2ca
  	    if (p == NULL)
3ef2ca
  	    {
3ef2ca
  		fclose(fd);
3ef2ca
  		goto errret;		/* type error; errmsg already given */
3ef2ca
  	    }
3ef2ca
! 	    len = STRLEN(p);
3ef2ca
! 	    if (len > 0 && fwrite(p, len, 1, fd) != 1)
3ef2ca
  		err = TRUE;
3ef2ca
  	}
3ef2ca
  	if (fclose(fd) != 0)
3ef2ca
*** ../vim-7.4.450/src/version.c	2014-09-19 20:07:22.550449677 +0200
3ef2ca
--- src/version.c	2014-09-19 20:19:22.390451249 +0200
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     451,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
167. You have more than 200 websites bookmarked.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///