From 1902d4338f1f1c324f9b652bbbf0bba602bb7ee5 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 28 Jan 2008 16:08:02 +0000 Subject: [PATCH] o Update dd(1) to accept capital letters (B, K, M, G) as size modifiers. o Remove the 3rd clause of the Berkeley license while here. --- bin/dd/args.c | 12 ++++++------ bin/dd/conv.c | 8 ++------ bin/dd/conv_tab.c | 8 ++------ bin/dd/dd.1 | 14 +++++++------- bin/dd/dd.c | 8 ++------ bin/dd/dd.h | 8 ++------ bin/dd/extern.h | 8 ++------ bin/dd/misc.c | 8 ++------ bin/dd/position.c | 8 ++------ 9 files changed, 27 insertions(+), 55 deletions(-) diff --git a/bin/dd/args.c b/bin/dd/args.c index 4e6bf0b768..2ed99936c7 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -36,7 +32,7 @@ * * @(#)args.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/args.c,v 1.25.2.2 2001/01/23 14:20:03 asmodai Exp $ - * $DragonFly: src/bin/dd/args.c,v 1.5 2004/03/19 17:17:46 cpressey Exp $ + * $DragonFly: src/bin/dd/args.c,v 1.6 2008/01/28 16:08:02 matthias Exp $ */ #include @@ -349,6 +345,7 @@ get_num(char *val) switch (*expr) { case 'b': + case 'B': t = num; num *= 512; if (t > num) @@ -356,6 +353,7 @@ get_num(char *val) ++expr; break; case 'k': + case 'K': t = num; num *= 1 << 10; if (t > num) @@ -363,6 +361,7 @@ get_num(char *val) ++expr; break; case 'm': + case 'M': t = num; num *= 1 << 20; if (t > num) @@ -370,6 +369,7 @@ get_num(char *val) ++expr; break; case 'g': + case 'G': t = num; num *= 1 << 30; if (t > num) diff --git a/bin/dd/conv.c b/bin/dd/conv.c index 39aad47335..64e8885c4e 100644 --- a/bin/dd/conv.c +++ b/bin/dd/conv.c @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -36,7 +32,7 @@ * * @(#)conv.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/conv.c,v 1.15 1999/09/13 21:47:10 green Exp $ - * $DragonFly: src/bin/dd/conv.c,v 1.5 2004/11/07 20:54:51 eirikn Exp $ + * $DragonFly: src/bin/dd/conv.c,v 1.6 2008/01/28 16:08:02 matthias Exp $ */ #include diff --git a/bin/dd/conv_tab.c b/bin/dd/conv_tab.c index 3310d80cd9..978f239fc8 100644 --- a/bin/dd/conv_tab.c +++ b/bin/dd/conv_tab.c @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -36,7 +32,7 @@ * * @(#)conv_tab.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/dd/conv_tab.c,v 1.10 1999/09/12 16:51:53 green Exp $ - * $DragonFly: src/bin/dd/conv_tab.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/dd/conv_tab.c,v 1.3 2008/01/28 16:08:02 matthias Exp $ */ #include diff --git a/bin/dd/dd.1 b/bin/dd/dd.1 index c06d6d2984..3596e85880 100644 --- a/bin/dd/dd.1 +++ b/bin/dd/dd.1 @@ -12,11 +12,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" @@ -34,9 +30,9 @@ .\" .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD: src/bin/dd/dd.1,v 1.15.2.5 2003/01/24 02:17:12 keramida Exp $ -.\" $DragonFly: src/bin/dd/dd.1,v 1.2 2003/06/17 04:22:49 dillon Exp $ +.\" $DragonFly: src/bin/dd/dd.1,v 1.3 2008/01/28 16:08:02 matthias Exp $ .\" -.Dd January 13, 1994 +.Dd January 28, 2008 .Dt DD 1 .Os .Sh NAME @@ -301,9 +297,13 @@ Where sizes are specified, a decimal, octal, or hexadecimal number of bytes is expected. If the number ends with a .Dq Li b , +.Dq Li B , .Dq Li k , +.Dq Li K , .Dq Li m , +.Dq Li M , .Dq Li g , +.Dq Li G , or .Dq Li w , the diff --git a/bin/dd/dd.c b/bin/dd/dd.c index 55d56eeb09..efb29ea765 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,7 +33,7 @@ * @(#) Copyright (c) 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)dd.c 8.5 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/dd.c,v 1.27.2.3 2001/08/01 01:37:35 obrien Exp $ - * $DragonFly: src/bin/dd/dd.c,v 1.8 2007/05/21 15:53:29 dillon Exp $ + * $DragonFly: src/bin/dd/dd.c,v 1.9 2008/01/28 16:08:02 matthias Exp $ */ #include diff --git a/bin/dd/dd.h b/bin/dd/dd.h index c0d3e1bfd8..a9215b3167 100644 --- a/bin/dd/dd.h +++ b/bin/dd/dd.h @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -36,7 +32,7 @@ * * @(#)dd.h 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/dd.h,v 1.15.2.1 2000/08/07 08:30:17 ps Exp $ - * $DragonFly: src/bin/dd/dd.h,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/dd/dd.h,v 1.3 2008/01/28 16:08:02 matthias Exp $ */ /* Input/output stream state. */ diff --git a/bin/dd/extern.h b/bin/dd/extern.h index 1b98e5f91f..99e0419ec5 100644 --- a/bin/dd/extern.h +++ b/bin/dd/extern.h @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -36,7 +32,7 @@ * * @(#)extern.h 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/extern.h,v 1.9.2.1 2000/08/07 08:30:17 ps Exp $ - * $DragonFly: src/bin/dd/extern.h,v 1.3 2003/09/21 04:19:42 drhodus Exp $ + * $DragonFly: src/bin/dd/extern.h,v 1.4 2008/01/28 16:08:02 matthias Exp $ */ #include diff --git a/bin/dd/misc.c b/bin/dd/misc.c index 27272efc14..ad94bdc1a0 100644 --- a/bin/dd/misc.c +++ b/bin/dd/misc.c @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -36,7 +32,7 @@ * * @(#)misc.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/misc.c,v 1.18.2.1 2001/08/01 01:40:03 obrien Exp $ - * $DragonFly: src/bin/dd/misc.c,v 1.5 2004/11/07 20:54:51 eirikn Exp $ + * $DragonFly: src/bin/dd/misc.c,v 1.6 2008/01/28 16:08:02 matthias Exp $ */ #include diff --git a/bin/dd/position.c b/bin/dd/position.c index 51b0a05cee..f5820a8cf4 100644 --- a/bin/dd/position.c +++ b/bin/dd/position.c @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -36,7 +32,7 @@ * * @(#)position.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/position.c,v 1.17.2.2 2001/01/23 14:23:55 asmodai Exp $ - * $DragonFly: src/bin/dd/position.c,v 1.3 2003/09/28 14:39:13 hmp Exp $ + * $DragonFly: src/bin/dd/position.c,v 1.4 2008/01/28 16:08:02 matthias Exp $ */ #include -- 2.41.0