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 | |
parent | 16c2c700fd26825fbd3e9591b5f590f5d2abf65d (diff) | |
download | busybox-5fa7148761097d067c3f6723ca55c6284d1152ac.tar.gz |
build system: add "release" target
find: support -size N (needed for above)
Diffstat (limited to 'findutils')
-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;)) USE_FEATURE_FIND_INUM( ACTS(inum, ino_t inode_num;)) USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; int *subst_count; int exec_argc;)) USE_DESKTOP( ACTS(paren, action ***subexpr;)) +USE_DESKTOP( ACTS(size, off_t size;)) USE_DESKTOP( ACTS(prune)) static action ***actions; @@ -225,6 +226,7 @@ ACTF(paren) { return exec_actions(ap->subexpr, fileName, statbuf); } + /* * -prune: if -depth is not given, return true and do not descend * current dir; if -depth is given, return false with no effect. @@ -235,6 +237,11 @@ ACTF(prune) { return SKIP; } + +ACTF(size) +{ + return statbuf->st_size == ap->size; +} #endif @@ -487,6 +494,13 @@ action*** parse_params(char **argv) else if (strcmp(arg, "-prune") == 0) { (void) ALLOC_ACTION(prune); } + else if (strcmp(arg, "-size") == 0) { + action_size *ap; + if (!*++argv) + bb_error_msg_and_die(bb_msg_requires_arg, arg); + ap = ALLOC_ACTION(size); + ap->size = XATOOFF(arg1); + } #endif else bb_show_usage(); |