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 <[EMAIL PROTECTED]>
> 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
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",
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"