summaryrefslogtreecommitdiffstats
path: root/bin/dd/gen.c
diff options
context:
space:
mode:
authorthomas <thomas@FreeBSD.org>2016-04-19 07:34:31 +0000
committerthomas <thomas@FreeBSD.org>2016-04-19 07:34:31 +0000
commitba53aa0560b6f6d7886d5162ca8e62f5757af8b4 (patch)
tree1ba7a57e2c1a78b9e5f2f86d89463c935edc2e5a /bin/dd/gen.c
parentdab85cf430c20f64caedfab11029a1c75239181c (diff)
downloadFreeBSD-src-ba53aa0560b6f6d7886d5162ca8e62f5757af8b4.zip
FreeBSD-src-ba53aa0560b6f6d7886d5162ca8e62f5757af8b4.tar.gz
MFC r295749:
Reorganize the handling all-zeroes terminal block in sparse mode PR: 189284 (original PR whose fix introduced this bug) PR: 207092
Diffstat (limited to 'bin/dd/gen.c')
-rw-r--r--bin/dd/gen.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/dd/gen.c b/bin/dd/gen.c
index 9c7571a..d53d8fb 100644
--- a/bin/dd/gen.c
+++ b/bin/dd/gen.c
@@ -5,13 +5,20 @@
*/
#include <stdio.h>
+#include <string.h>
int
-main(int argc __unused, char **argv __unused)
+main(int argc, char **argv)
{
int i;
- for (i = 0; i < 256; i++)
- putchar(i);
+ if (argc > 1 && !strcmp(argv[1], "189284")) {
+ fputs("ABCDEFGH", stdout);
+ for (i = 0; i < 8; i++)
+ putchar(0);
+ } else {
+ for (i = 0; i < 256; i++)
+ putchar(i);
+ }
return (0);
}
OpenPOWER on IntegriCloud