Hi,
xxd so far always writes to standard out when generating a postscript
hexdump, even when an output file has been specified. The patch below
fixes that.
Florian
diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
index 41f8a24..9f47fef 100644
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -707,17 +707,17 @@ char *argv[];
p = cols;
while ((length < 0 || n < length) && (e = getc(fp)) != EOF)
{
- putchar(hexx[(e >> 4) & 0xf]);
- putchar(hexx[(e ) & 0xf]);
+ putc(hexx[(e >> 4) & 0xf], fpo);
+ putc(hexx[(e ) & 0xf], fpo);
n++;
if (!--p)
{
- putchar('\n');
+ putc('\n', fpo);
p = cols;
}
}
if (p < cols)
- putchar('\n');
+ putc('\n', fpo);
fclose(fp);
fclose(fpo);
return 0;
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php