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)
diff --git a/src/version.c b/src/version.c
index 309732a..f1a0909 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 835,
+/**/
834,
/**/
833,
diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
index 85300dc..209ede4 100644
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -729,9 +729,10 @@
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)
{