From owner-cvs-all@FreeBSD.ORG Thu Jun 1 21:10:10 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C59E16C578; Thu, 1 Jun 2006 21:10:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1318043DAA; Thu, 1 Jun 2006 21:09:43 +0000 (GMT) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.1/8.13.1) with ESMTP id k51L9fsO018339; Thu, 1 Jun 2006 17:09:42 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kirill Ponomarew Date: Thu, 1 Jun 2006 17:09:26 -0400 User-Agent: KMail/1.6.2 References: <200605271827.k4RIRf7G078768@repoman.freebsd.org> In-Reply-To: <200605271827.k4RIRf7G078768@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_Ie1fErgPmDISPAA" Message-Id: <200606011709.28816.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV 0.88/1505/Thu Jun 1 14:29:37 2006 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/find find.1 function.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2006 21:10:41 -0000 --Boundary-00=_Ie1fErgPmDISPAA Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Saturday 27 May 2006 02:27 pm, Kirill Ponomarew wrote: > krion 2006-05-27 18:27:41 UTC > > FreeBSD src repository > > Modified files: > usr.bin/find find.1 function.c > Log: > Add the capability for a trailing scale indicator to cause the > specified size to be read in the more familiar units of > kilobytes, megabytes, gigabytes, terabytes and petabytes. > > PR: bin/50988 > Submitted by: Matthew Seaman > MFC after: 7 days > > Revision Changes Path > 1.77 +21 -2 src/usr.bin/find/find.1 > 1.58 +35 -3 src/usr.bin/find/function.c off_t may not be long long. I think you should do something like the attached patch and you may just remove the comments. Thanks! Jung-uk Kim --Boundary-00=_Ie1fErgPmDISPAA Content-Type: text/x-diff; charset="iso-8859-1"; name="find.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="find.diff" Index: function.c =================================================================== RCS file: /home/ncvs/src/usr.bin/find/function.c,v retrieving revision 1.58 diff -u -r1.58 function.c --- function.c 27 May 2006 18:27:41 -0000 1.58 +++ function.c 1 Jun 2006 21:01:00 -0000 @@ -1399,24 +1399,24 @@ if (endch != '\0') { divsize = 0; + scale = 1; switch (endch) { case 'c': /* characters */ - scale = 0x1LL; break; case 'k': /* kilobytes 1<<10 */ - scale = 0x400LL; + scale <<= 10; break; case 'M': /* megabytes 1<<20 */ - scale = 0x100000LL; + scale <<= 20; break; case 'G': /* gigabytes 1<<30 */ - scale = 0x40000000LL; + scale <<= 30; break; case 'T': /* terabytes 1<<40 */ - scale = 0x1000000000LL; + scale <<= 40; break; case 'P': /* petabytes 1<<50 */ - scale = 0x4000000000000LL; + scale <<= 50; break; default: errx(1, "%s: %s: illegal trailing character", --Boundary-00=_Ie1fErgPmDISPAA--