The following reply was made to PR user/6492; it has been noted by GNATS.
From: "Todd C. Miller" <[email protected]>
To: Ralf Horstmann <[email protected]>
Cc: [email protected]
Subject: Re: user/6492: hexdump -s -n is broken
Date: Thu, 21 Oct 2010 14:07:15 -0400
This should resolve the problem.
- todd
Index: display.c
===================================================================
RCS file: /home/cvs/openbsd/src/usr.bin/hexdump/display.c,v
retrieving revision 1.19
diff -u -r1.19 display.c
--- display.c 12 Oct 2010 17:23:21 -0000 1.19
+++ display.c 21 Oct 2010 18:05:56 -0000
@@ -306,15 +306,14 @@
return(0);
statok = 0;
}
+ if (iobuf != NULL)
+ setvbuf(stdin, iobuf, _IOFBF, iobufsiz);
if (skip)
doskip(statok ? *_argv : "stdin", statok);
if (*_argv)
++_argv;
- if (!skip) {
- if (iobuf != NULL)
- setvbuf(stdin, iobuf, _IOFBF, iobufsiz);
+ if (!skip)
return(1);
- }
}
/* NOTREACHED */
}