Skip to content

Commit 32679a2

Browse files
committed
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)
1 parent 5ea50c0 commit 32679a2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ static char *(features[]) =
728728

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
835,
731733
/**/
732734
834,
733735
/**/

src/xxd/xxd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,10 @@ main(argc, argv)
729729
if (c == EOF && ferror(fp))
730730
die(2);
731731

732-
if (p)
733-
if (fputs("\n};\n" + 3 * (fp == stdin), fpo) == EOF)
734-
die(3);
732+
if (p && fputs("\n", fpo) == EOF)
733+
die(3);
734+
if (fputs("};\n" + 3 * (fp == stdin), fpo) == EOF)
735+
die(3);
735736

736737
if (fp != stdin)
737738
{

0 commit comments

Comments
 (0)