Date: Wed, 17 Jun 2009 20:55:49 +0200 (CEST) From: Alexander Best <alexbestms@math.uni-muenster.de> To: <freebsd-hackers@freebsd.org> Subject: small usr.bin/find patch Message-ID: <permail-200906171855491e86ffa800003434-a_best01@message-id.uni-muenster.de>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
hi everybody,
here's just a quick hack i applied to find. i very often use the -size switch
and always forget if you need to append "m" or "M" for megabyte or "k" or "K"
for kilobyte. after applying the patch find accepts both. ;-)
cheers.
[-- Attachment #2 --]
--- usr.bin/find/function.c 2009-06-17 20:39:27.000000000 +0200
+++ usr.bin/find/function.c 2009-06-17 20:41:09.000000000 +0200
@@ -1433,22 +1433,28 @@
divsize = 0;
switch (endch) {
- case 'c': /* characters */
+ case 'C': /* characters */
+ case 'c':
scale = 0x1LL;
break;
- case 'k': /* kilobytes 1<<10 */
+ case 'K': /* kilobytes 1<<10 */
+ case 'k':
scale = 0x400LL;
break;
case 'M': /* megabytes 1<<20 */
+ case 'm':
scale = 0x100000LL;
break;
case 'G': /* gigabytes 1<<30 */
+ case 'g':
scale = 0x40000000LL;
break;
case 'T': /* terabytes 1<<40 */
+ case 't':
scale = 0x1000000000LL;
break;
case 'P': /* petabytes 1<<50 */
+ case 'p':
scale = 0x4000000000000LL;
break;
default:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-200906171855491e86ffa800003434-a_best01>
