Print this page
2556 dd should accept M,G,T,... for sizes
*** 21,30 ****
--- 21,31 ----
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012, Josef 'Jeff' Sipek <jeffpc@31bits.net>. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
*** 1640,1650 ****
/* Convert a numeric arg to binary */
/* */
/* Arg: big - maximum valid input number */
/* Global arg: string - pointer to command arg */
/* */
! /* Valid forms: 123 | 123k | 123w | 123b | 123*123 | 123x123 */
/* plus combinations such as 2b*3kw*4w */
/* */
/* Return: converted number */
/* */
/* ******************************************************************** */
--- 1641,1652 ----
/* Convert a numeric arg to binary */
/* */
/* Arg: big - maximum valid input number */
/* Global arg: string - pointer to command arg */
/* */
! /* Valid forms: 123 | 123k | 123M | 123G | 123T | 123P | 123E | 123Z | */
! /* 123w | 123b | 123*123 | 123x123 */
/* plus combinations such as 2b*3kw*4w */
/* */
/* Return: converted number */
/* */
/* ******************************************************************** */
*** 1666,1675 ****
--- 1668,1701 ----
for (;;)
{
switch (*cs++)
{
+ case 'Z':
+ n *= 1024;
+ /* FALLTHROUGH */
+
+ case 'E':
+ n *= 1024;
+ /* FALLTHROUGH */
+
+ case 'P':
+ n *= 1024;
+ /* FALLTHROUGH */
+
+ case 'T':
+ n *= 1024;
+ /* FALLTHROUGH */
+
+ case 'G':
+ n *= 1024;
+ /* FALLTHROUGH */
+
+ case 'M':
+ n *= 1024;
+ /* FALLTHROUGH */
+
case 'k':
n *= 1024;
continue;
case 'w':