ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit c64b5b04c7993765ab67207e86db92a48d7087f4
parent e5d88b0f30feb2f0374c2e09ecd2685ba1f4e717
Author: Eivind Uggedal <eivind@uggedal.com>
Date:   Tue, 15 Mar 2016 20:16:05 +0000

dd: allow count=0

Diffstat:
Mdd.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dd.c b/dd.c @@ -126,7 +126,7 @@ prepare_copy(struct dd_config *ddc, int *ifd, int *ofd) ddc->count *= ddc->bs; /* If no count is given, its the filesize minus skip offset */ - if (ddc->count == 0) + if (ddc->count == (uint64_t) -1) ddc->count = ddc->fsize - ddc->skip; return 0; @@ -243,6 +243,7 @@ main(int argc, char *argv[]) config.bs = 1<<16; config.in = NULL; config.out = NULL; + config.count = (uint64_t) -1; /* emulate 'dd' argument parsing */ for (i = 1; i < argc; ++i) {