projects
/
dus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a34d61
)
Added the units 'b' and 'B' for the min size specification
author
Francois Fleuret
<francois@fleuret.org>
Sun, 27 Jun 2010 12:08:01 +0000
(14:08 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Sun, 27 Jun 2010 12:08:01 +0000
(14:08 +0200)
dus.c
patch
|
blob
|
history
diff --git
a/dus.c
b/dus.c
index
a9ceedc
..
b90a0bd
100644
(file)
--- 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;