diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-10-18 09:37:36 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-10-18 09:37:36 +0000 |
commit | de1642a149d6fe33d43bf0d3a380927fff636f05 (patch) | |
tree | 99a2f6ade9bd01188f1c980678d8c424b0cb80be /bin | |
parent | 2cfe40a2652d4fbe607054a2374305c51c7674ce (diff) |
Support K and M as well as k and m for sizes. From Thomas Pfaff.
ok millert jmc
Diffstat (limited to 'bin')
-rw-r--r-- | bin/dd/args.c | 6 | ||||
-rw-r--r-- | bin/dd/dd.1 | 16 |
2 files changed, 16 insertions, 6 deletions
diff --git a/bin/dd/args.c b/bin/dd/args.c index 9e4d573c31a..c0d1f1b8cc4 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -1,4 +1,4 @@ -/* $OpenBSD: args.c,v 1.18 2009/10/27 23:59:21 deraadt Exp $ */ +/* $OpenBSD: args.c,v 1.19 2011/10/18 09:37:35 nicm Exp $ */ /* $NetBSD: args.c,v 1.7 1996/03/01 01:18:58 jtc Exp $ */ /*- @@ -341,6 +341,7 @@ get_bsz(char *val) ++expr; break; case 'k': + case 'K': t = num; num *= 1024; if (t > num) @@ -348,6 +349,7 @@ get_bsz(char *val) ++expr; break; case 'm': + case 'M': t = num; num *= 1048576; if (t > num) @@ -411,6 +413,7 @@ get_off(char *val) ++expr; break; case 'k': + case 'K': t = num; num *= 1024; if (t > num) @@ -418,6 +421,7 @@ get_off(char *val) ++expr; break; case 'm': + case 'M': t = num; num *= 1048576; if (t > num) diff --git a/bin/dd/dd.1 b/bin/dd/dd.1 index 6ff218ad045..097f0f5149d 100644 --- a/bin/dd/dd.1 +++ b/bin/dd/dd.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: dd.1,v 1.24 2010/09/03 09:53:20 jmc Exp $ +.\" $OpenBSD: dd.1,v 1.25 2011/10/18 09:37:35 nicm Exp $ .\" $NetBSD: dd.1,v 1.5 1995/03/21 09:04:04 cgd Exp $ .\" .\" Copyright (c) 1990, 1993 @@ -33,7 +33,7 @@ .\" .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" -.Dd $Mdocdate: September 3 2010 $ +.Dd $Mdocdate: October 18 2011 $ .Dt DD 1 .Os .Sh NAME @@ -279,8 +279,12 @@ appended. Where sizes are specified, a decimal number of bytes is expected. If the number ends with a .Sq b , -.Sq k , -.Sq m , +.Sq k +or +.Sq K , +.Sq m +or +.Sq M , or .Sq w , the number @@ -375,7 +379,9 @@ the conversions and .Cm osync , and the size multipliers -.Sq m +.Sq K , +.Sq m , +.Sq M , and .Sq w are all extensions to those specifications. |