summaryrefslogtreecommitdiff
path: root/src/xxd/xxd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-02-26 14:14:07 +0100
committerBram Moolenaar <Bram@vim.org>2013-02-26 14:14:07 +0100
commit53eb37e9f9dfba51092f72553d79d3bb677a336b (patch)
tree2d8e5bb3d0fc882d6a4ea5bd140c0b5b3b9e84a9 /src/xxd/xxd.c
parent886ed691d26dd0253608eee174fecc24130e4de7 (diff)
downloadvim-53eb37e9f9dfba51092f72553d79d3bb677a336b.zip
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)
Diffstat (limited to 'src/xxd/xxd.c')
-rw-r--r--src/xxd/xxd.c7
1 files changed, 4 insertions, 3 deletions
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)
{