From b2fe75d8869c39badff3381fd9bde0f58b8ee7ce Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Sun, 27 Jun 2010 14:08:01 +0200 Subject: [PATCH] Added the units 'b' and 'B' for the min size specification --- dus.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dus.c b/dus.c index a9ceedc..b90a0bd 100644 --- a/dus.c +++ b/dus.c @@ -136,6 +136,9 @@ size_sum_t atoss(const char *string) { for(c = string; *c; c++) { if(*c >= '0' && *c <= '9') { partial_total = 10 * partial_total + ((int) (*c - '0')); + } else if(*c == 'B' || *c == 'b') { + total += partial_total; + partial_total = 0; } else if(*c == 'K' || *c == 'k') { total += partial_total * 1024; partial_total = 0; -- 2.20.1