Bug 7920

Summary: find . -name "$mask1" -or -name "$mask2" works incorrectly with -print, -printf and -print0
Product: Sisyphus Reporter: evseev <evseev>
Component: findutilsAssignee: placeholder <placeholder>
Status: CLOSED NOTABUG QA Contact: qa-sisyphus
Severity: normal    
Priority: P2 CC: glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   

Description evseev 2005-09-11 02:18:48 MSD
find utility ignores complex search expressions when '-print*' is used.
Steps to Reproduce:
1. Lookup any source directory with many *.c and *.h files.
2. find /path/to/source -name "*.h" -or -name "*.c" | grep '\.c$'
3. find /path/to/source -name "*.h" -or -name "*.c" -print | grep '\.c$'
Actual Results:  
Files with second wildcard are ignored, only first wildcard is handled 
correctly.

Expected Results:  
All wildcards should be handled.
Comment 1 Dmitry V. Levin 2005-09-11 21:58:36 MSD
The 3rd case is equivalent of
find /path/to/source -name "*.h" -or "(" -name "*.c" -print ")"
you probably want to use
find /path/to/source "(" -name "*.h" -or -name "*.c" ")" -print