diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-12 22:31:15 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-12 22:31:15 +0000 |
commit | 5fa7148761097d067c3f6723ca55c6284d1152ac (patch) | |
tree | 94e33f089502ba8625c31f72b93ae365e906d9d0 /findutils/find.c | |
parent | 16c2c700fd26825fbd3e9591b5f590f5d2abf65d (diff) | |
download | busybox-w32-5fa7148761097d067c3f6723ca55c6284d1152ac.tar.gz busybox-w32-5fa7148761097d067c3f6723ca55c6284d1152ac.tar.bz2 busybox-w32-5fa7148761097d067c3f6723ca55c6284d1152ac.zip |
build system: add "release" target
find: support -size N (needed for above)
Diffstat (limited to 'findutils/find.c')
-rw-r--r-- | findutils/find.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/findutils/find.c b/findutils/find.c index edb8482d8..bf6b71a83 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -69,6 +69,7 @@ USE_FEATURE_FIND_NEWER( ACTS(newer, time_t newer_mtime;)) | |||
69 | USE_FEATURE_FIND_INUM( ACTS(inum, ino_t inode_num;)) | 69 | USE_FEATURE_FIND_INUM( ACTS(inum, ino_t inode_num;)) |
70 | USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; int *subst_count; int exec_argc;)) | 70 | USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; int *subst_count; int exec_argc;)) |
71 | USE_DESKTOP( ACTS(paren, action ***subexpr;)) | 71 | USE_DESKTOP( ACTS(paren, action ***subexpr;)) |
72 | USE_DESKTOP( ACTS(size, off_t size;)) | ||
72 | USE_DESKTOP( ACTS(prune)) | 73 | USE_DESKTOP( ACTS(prune)) |
73 | 74 | ||
74 | static action ***actions; | 75 | static action ***actions; |
@@ -225,6 +226,7 @@ ACTF(paren) | |||
225 | { | 226 | { |
226 | return exec_actions(ap->subexpr, fileName, statbuf); | 227 | return exec_actions(ap->subexpr, fileName, statbuf); |
227 | } | 228 | } |
229 | |||
228 | /* | 230 | /* |
229 | * -prune: if -depth is not given, return true and do not descend | 231 | * -prune: if -depth is not given, return true and do not descend |
230 | * current dir; if -depth is given, return false with no effect. | 232 | * current dir; if -depth is given, return false with no effect. |
@@ -235,6 +237,11 @@ ACTF(prune) | |||
235 | { | 237 | { |
236 | return SKIP; | 238 | return SKIP; |
237 | } | 239 | } |
240 | |||
241 | ACTF(size) | ||
242 | { | ||
243 | return statbuf->st_size == ap->size; | ||
244 | } | ||
238 | #endif | 245 | #endif |
239 | 246 | ||
240 | 247 | ||
@@ -487,6 +494,13 @@ action*** parse_params(char **argv) | |||
487 | else if (strcmp(arg, "-prune") == 0) { | 494 | else if (strcmp(arg, "-prune") == 0) { |
488 | (void) ALLOC_ACTION(prune); | 495 | (void) ALLOC_ACTION(prune); |
489 | } | 496 | } |
497 | else if (strcmp(arg, "-size") == 0) { | ||
498 | action_size *ap; | ||
499 | if (!*++argv) | ||
500 | bb_error_msg_and_die(bb_msg_requires_arg, arg); | ||
501 | ap = ALLOC_ACTION(size); | ||
502 | ap->size = XATOOFF(arg1); | ||
503 | } | ||
490 | #endif | 504 | #endif |
491 | else | 505 | else |
492 | bb_show_usage(); | 506 | bb_show_usage(); |