diff options
author | thomas <thomas@FreeBSD.org> | 2016-04-19 07:34:31 +0000 |
---|---|---|
committer | thomas <thomas@FreeBSD.org> | 2016-04-19 07:34:31 +0000 |
commit | ba53aa0560b6f6d7886d5162ca8e62f5757af8b4 (patch) | |
tree | 1ba7a57e2c1a78b9e5f2f86d89463c935edc2e5a /bin/dd/gen.c | |
parent | dab85cf430c20f64caedfab11029a1c75239181c (diff) | |
download | FreeBSD-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.c | 13 |
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); } |