From 53eb37e9f9dfba51092f72553d79d3bb677a336b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 26 Feb 2013 14:14:07 +0100 Subject: [PATCH] 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) --- src/version.c | 2 ++ src/xxd/xxd.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/version.c b/src/version.c index 309732afb..f1a090921 100644 --- a/src/version.c +++ b/src/version.c @@ -728,6 +728,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 835, /**/ 834, /**/ diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c index 85300dc9d..209ede43d 100644 --- 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) { -- 2.40.0