changeset 4166:d356b5ce84ce v7.3.835

updated for version 7.3.835 Problem: "xxd -i" fails on an empty file. Solution: Do output the closing } for an empty file. (partly by Lawrence Woodman)
author Bram Moolenaar <bram@vim.org>
date Tue, 26 Feb 2013 14:14:07 +0100
parents 59b67ae4abc7
children 71e95ad234a6
files src/version.c src/xxd/xxd.c
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    835,
+/**/
     834,
 /**/
     833,
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -729,9 +729,10 @@ main(argc, argv)
       if (c == EOF && ferror(fp))
 	die(2);
 
-      if (p)
-	if (fputs("\n};\n" + 3 * (fp == stdin), fpo) == EOF)
-	  die(3);
+      if (p && fputs("\n", fpo) == EOF)
+	die(3);
+      if (fputs("};\n" + 3 * (fp == stdin), fpo) == EOF)
+	die(3);
 
       if (fp != stdin)
 	{