diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-31 03:20:13 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-31 03:20:13 +0000 |
commit | a3b4fed8b3056b1a7429f809ed310512c1bd3a1e (patch) | |
tree | 4dfd25f62687b1b49eb63a617cf7250f31e18b9d /findutils/find.c | |
parent | 6191a7a007ff2e22cbf48f323d4e11d9b959fe85 (diff) | |
download | busybox-w32-a3b4fed8b3056b1a7429f809ed310512c1bd3a1e.tar.gz busybox-w32-a3b4fed8b3056b1a7429f809ed310512c1bd3a1e.tar.bz2 busybox-w32-a3b4fed8b3056b1a7429f809ed310512c1bd3a1e.zip |
find: fix implicit -print (sometime differed from standard)
Diffstat (limited to 'findutils/find.c')
-rw-r--r-- | findutils/find.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/findutils/find.c b/findutils/find.c index 3c7e66a56..21ea9d422 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -35,6 +35,14 @@ | |||
35 | * file.txt | 35 | * file.txt |
36 | * # find file.txt -name '*f*' -o -name '*z*' | 36 | * # find file.txt -name '*f*' -o -name '*z*' |
37 | * file.txt | 37 | * file.txt |
38 | * | ||
39 | * # find t z -name '*t*' -print -o -name '*z*' | ||
40 | * t | ||
41 | * # find t z t z -name '*t*' -o -name '*z*' -print | ||
42 | * z | ||
43 | * z | ||
44 | * # find t z t z '(' -name '*t*' -o -name '*z*' ')' -o -print | ||
45 | * (no output) | ||
38 | */ | 46 | */ |
39 | 47 | ||
40 | #include "busybox.h" | 48 | #include "busybox.h" |
@@ -193,7 +201,6 @@ SFUNC(exec) | |||
193 | bb_perror_msg("%s", argv[0]); | 201 | bb_perror_msg("%s", argv[0]); |
194 | for (i = 0; i < ap->exec_argc; i++) | 202 | for (i = 0; i < ap->exec_argc; i++) |
195 | free(argv[i]); | 203 | free(argv[i]); |
196 | need_print = 0; | ||
197 | return rc == 0; /* return 1 if success */ | 204 | return rc == 0; /* return 1 if success */ |
198 | } | 205 | } |
199 | #endif | 206 | #endif |
@@ -202,7 +209,6 @@ SFUNC(exec) | |||
202 | SFUNC(print0) | 209 | SFUNC(print0) |
203 | { | 210 | { |
204 | printf("%s%c", fileName, '\0'); | 211 | printf("%s%c", fileName, '\0'); |
205 | need_print = 0; | ||
206 | return TRUE; | 212 | return TRUE; |
207 | } | 213 | } |
208 | #endif | 214 | #endif |
@@ -210,7 +216,6 @@ SFUNC(print0) | |||
210 | SFUNC(print) | 216 | SFUNC(print) |
211 | { | 217 | { |
212 | puts(fileName); | 218 | puts(fileName); |
213 | need_print = 0; | ||
214 | return TRUE; | 219 | return TRUE; |
215 | } | 220 | } |
216 | 221 | ||
@@ -331,10 +336,12 @@ action*** parse_params(char **argv) | |||
331 | 336 | ||
332 | /* --- Tests and actions --- */ | 337 | /* --- Tests and actions --- */ |
333 | else if (strcmp(arg, "-print") == 0) { | 338 | else if (strcmp(arg, "-print") == 0) { |
339 | need_print = 0; | ||
334 | (void) ALLOC_ACTION(print); | 340 | (void) ALLOC_ACTION(print); |
335 | } | 341 | } |
336 | #if ENABLE_FEATURE_FIND_PRINT0 | 342 | #if ENABLE_FEATURE_FIND_PRINT0 |
337 | else if (strcmp(arg, "-print0") == 0) { | 343 | else if (strcmp(arg, "-print0") == 0) { |
344 | need_print = 0; | ||
338 | (void) ALLOC_ACTION(print0); | 345 | (void) ALLOC_ACTION(print0); |
339 | } | 346 | } |
340 | #endif | 347 | #endif |
@@ -420,6 +427,7 @@ action*** parse_params(char **argv) | |||
420 | else if (strcmp(arg, "-exec") == 0) { | 427 | else if (strcmp(arg, "-exec") == 0) { |
421 | int i; | 428 | int i; |
422 | action_exec *ap; | 429 | action_exec *ap; |
430 | need_print = 0; | ||
423 | ap = ALLOC_ACTION(exec); | 431 | ap = ALLOC_ACTION(exec); |
424 | ap->exec_argv = ++argv; /* first arg after -exec */ | 432 | ap->exec_argv = ++argv; /* first arg after -exec */ |
425 | ap->exec_argc = 0; | 433 | ap->exec_argc = 0; |