Hi,
> xxd so far for the most part just ignores any errors, happily aborting
> with success on I/O errors, chewing away on the CPU when the destination
> FS is full, and the like. The patch below (hopefully) fixes that.
Below another instance I missed before - to be applied after that
pname simplification patch.
Florian
diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
index 6be1a02..18a63d4 100644
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -711,6 +711,7 @@ char *argv[];
}
p = 0;
+ c = 0;
while ((length < 0 || p < length) && (c = getc(fp)) != EOF)
{
if (fprintf(fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X",
@@ -718,6 +719,8 @@ char *argv[];
die(3);
p++;
}
+ if (c == EOF && ferror(fp))
+ die(2);
if (p)
if (fputs("\n};\n"+3*(fp == stdin), fpo) == EOF)
--
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