Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.3.835
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.835
Problem:    "xxd -i" fails on an empty file.
Solution:   Do output the closing } for an empty file. (partly by Lawrence
	    Woodman)
Files:	    src/xxd/xxd.c


*** ../vim-7.3.834/src/xxd/xxd.c	2011-04-11 21:35:03.000000000 +0200
--- src/xxd/xxd.c	2013-02-26 14:08:48.000000000 +0100
***************
*** 729,737 ****
        if (c == EOF && ferror(fp))
  	die(2);
  
!       if (p)
! 	if (fputs("\n};\n" + 3 * (fp == stdin), fpo) == EOF)
! 	  die(3);
  
        if (fp != stdin)
  	{
--- 729,738 ----
        if (c == EOF && ferror(fp))
  	die(2);
  
!       if (p && fputs("\n", fpo) == EOF)
! 	die(3);
!       if (fputs("};\n" + 3 * (fp == stdin), fpo) == EOF)
! 	die(3);
  
        if (fp != stdin)
  	{
*** ../vim-7.3.834/src/version.c	2013-02-26 13:41:31.000000000 +0100
--- src/version.c	2013-02-26 14:11:21.000000000 +0100
***************
*** 730,731 ****
--- 730,733 ----
  {   /* Add new patch number below this line */
+ /**/
+     835,
  /**/

-- 
For society, it's probably a good thing that engineers value function over
appearance.  For example, you wouldn't want engineers to build nuclear power
plants that only _look_ like they would keep all the radiation inside.
				(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///