Commit Graph

104 Commits

Author SHA1 Message Date
tjr
4b13345281 Support the SysV-style -exec utility args.. {} + function, required by
SUSv3. This is similar to find foo -print0 | xargs -0 utility args.
2002-06-02 12:57:41 +00:00
ru
b94acdcb71 mdoc(7) police: markup nits. 2002-05-29 18:26:16 +00:00
jmallett
77aa53fe0e Clean up malloc(3)'s argument. Remove casts which do nothing when we're
using sizeof() anyway.  Use slightly more consistent (per-file) error
reporting for malloc(3) returning NULL.  If "malloc failed" was being printed,
don't use err(3).  If a NULL format is being used, use err(3).  In one case
errx(3) was being used with strerror(3), so just use err(3).
2002-05-17 05:11:07 +00:00
trhodes
ec2a348c1f More consistancy. file system > filesystem 2002-05-16 02:19:14 +00:00
charnier
a426ff29b9 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
obrien
6df9530096 Fix to WARNS=2 level.
Tested by:	AXP gcc 3.1
2002-04-15 19:27:41 +00:00
obrien
d7c46936c0 Clean up the 1/2 a** committing from Thu, 3 May 2001 11:05:39 -0700 (PDT).
Since then we have living with a GPL'ed find(1) due to grabbing getdate.y
from src/contrib/cvs and its user of the GPL'ed xtime.h.  I don't even want
to think about how this could have affected people using our source base.

Would it have been too much trouble to do then what I did now?
Copied getdate.y (public domain) to usr.bin/find and change to use
standard system headers.  find(1) now compiles simply with out having
to go to extra effort to do so.

Pointed hat to:	phk
Build fixed on:	gcc 3.1 using platforms
2002-04-14 01:30:20 +00:00
charnier
09b932a6a0 Replace err() with errx(), errno is garbage in this context. 2002-04-12 21:25:16 +00:00
trhodes
667f7d5e24 find.1 does not encourage users to DTRT when piping to xargs(1)
PR:			36602
Submitted by:		Joshua Goodall <joshua@roughtrade.net>
No objections from:	ru
MFC after:		2 days
2002-04-10 16:39:22 +00:00
markm
53d7551a7b There is breakage in parsedate, so revert to get_date until this can be
resolved.

Reported by:	paul
2002-04-02 10:45:34 +00:00
jmallett
3a5469b3d9 Fix find -exec with no command specified (i.e.: find . -exec ';')
PR:		bin/36521
Submitted by:	Simon 'corecode' Schubert <corecode@corecode.ath.cx>
Reviewed by:	mike
MFC after:	3 days
2002-04-02 07:20:56 +00:00
obrien
8dfcc4486e Fix SCM IDs. 2002-04-01 22:56:56 +00:00
obrien
dc2ea97c91 Allow to compile a YACC produced file with GCC 3.1 (which has different
header searching rules for generated files with #line).
2002-04-01 22:55:01 +00:00
keramida
ebb0db5c89 Run find.1 through ispell.
PR:		docs/36601
Submitted by:	Joshua Goodall <joshua@roughtrade.net>
MFC after:	3 days
2002-04-01 12:41:14 +00:00
dwmalone
30a8e35f69 Change a "/*" within a comment to a "**".
Add a missing include spotted by gcc30.
2002-03-30 13:54:53 +00:00
charnier
0bcfef4de7 spelling 2002-03-26 12:05:35 +00:00
markm
df90146ed9 Restructure for own parsedate (replacement for get_date from CVS).
Fix up parsedate.y for WARNS=4.

Reviewd by:	bde (except for parsedate.y diffs)
2002-03-21 21:56:05 +00:00
markm
e76e3bf95b Add a replacement for get_date which is currently being dug out of
CVS's sources.

This is a "public domain" implementation stolen from INN, and is
added unmodified.
2002-03-21 21:43:50 +00:00
markm
27dfe48134 For the sake of consistency, remove an include that is included in
a previous include. All other files in this app do this.
2002-03-20 10:35:51 +00:00
markm
5fd0efe585 Remove __P(). 2002-03-20 10:32:05 +00:00
dwmalone
f710f50d2e 1) Remove -Wall from Makefile.
2) WARNs fixes (rename option to lookup_option to avoid shadowing, rename
   argv to argv1 to avoid shadowing, const stuff, prototypes, __unused).
3) Remove "register"s.
2002-02-27 17:57:00 +00:00
imp
1e7fa14cdb Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h.  Update the man pages.

Submitted by: David Malone
Pointy hat to: imp
2002-02-19 00:05:59 +00:00
ru
70545fd624 Add a missing comma. 2001-11-20 15:45:29 +00:00
obrien
d0e1f2b7bb Document -depth 2001-10-06 18:07:32 +00:00
ru
e3a9c7b564 Simplify f_Xtime(). 2001-09-14 13:42:26 +00:00
ru
9e8f597b79 Bloat find(1) even more, and introduce the concept
of time units to be used with -[acm]time primaries.

Based on patch from Nils M Holm <nmh@t3x.org>.

PR:		bin/29165, bin/30309
2001-09-14 12:47:13 +00:00
ru
060d3f6fd5 The implementation of -flags was broken and did not match the (poorly)
documented behavior.  Only a certain set of file flags were recognized,
and "no" flags did not match files that have corresponding flags bits
turned off.

Fix and extend the -flags functionality as follows:

: -flags [-|+]<flags>,<notflags>
:    The flags are specified using symbolic names (see chflags(1)).
:    Those with the "no" prefix (except "nodump") are said to be
:    <notflags>.  Flags in <flags> are checked to be set, and flags in
:    <notflags> are checked to be not set.  Note that this is different
:    from -perm, which only allows the user to specify mode bits that
:    are set.
:
:    If flags are preceded by a dash (``-''), this primary evaluates
:    to true if at least all of the bits in <flags> and none of the bits
:    in <notflags> are set in the file's flags bits.  If flags are pre-
:    ceded by a plus (``+''), this primary evaluates to true if any of
:    the bits in <flags> is set in the file's flags bits, or any of the
:    bits in <notflags> is not set in the file's flags bits.  Otherwise,
:    this primary evaluates to true if the bits in <flags> exactly match
:    the file's flags bits, and none of the <flags> bits match those of
:    <notflags>.

MFC after:	2 weeks
2001-09-04 16:09:01 +00:00
ru
93da947b85 Sort predicates.
PR:		docs/30237
2001-08-31 15:48:00 +00:00
ru
907a5b0bd3 Restore the `-perm +mode' feature.
Broken in the "close a PR" race, in revision 1.30.
Note that the patch in the PR did not have this bug!
2001-08-30 13:17:58 +00:00
obrien
03744c4baf Remove emalloc and expand to the malloc + error checking it was, where used. 2001-07-24 14:12:05 +00:00
obrien
18e9b76914 Quiet a [useless] compiler warning. 2001-07-23 23:27:28 +00:00
yar
a9aa29bd59 Clarify the feature that -exec parameters won't get
shell-expanded when the specified utility is run.

MFC after:	5 days
2001-06-29 12:59:20 +00:00
ru
ce0c318edf mdoc(7) police: fix markup. 2001-05-16 13:53:19 +00:00
phk
616525a24b They add the following commands:
-anewer
   -cnewer
   -mnewer
   -okdir
   -newer[acm][acmt]

 With it, you can form queries like

     find . -newerct '1 minute ago' -print

 As an extra bonus, the program is ANSI-fied - the original version
 relies on some obscure features of K&R C.

(This PR was submitted in 1999, and the submittor has kept the patch
updated ever since, hats off for him guys, and how about you close a PR ??)

PR:		9374
Submitted by:	Martin Birgmeier <Martin.Birgmeier@aon.at>
2001-05-03 18:05:35 +00:00
ache
50c81a83ce Don't attempt to parse %c, use nl_langinfo instead 2001-03-21 15:51:50 +00:00
imp
86d920c88f MAXPATHLEN already accounts for the trailing NUL, so no need to add one in.
In addition, since we pass readlink MAXPATHLEN - 1, we would have never have
used that extra byte anyway.
2001-03-01 05:49:36 +00:00
ru
b0425aa73b mdoc(7) police: restore correct order of references in the SEE ALSO. 2001-02-24 10:30:27 +00:00
knu
86c6c51fa7 Implement the following options and primaries:
-E      Interpret regular expressions followed by -regex and -iregex op-
             tions as extended (modern) regular expressions rather than basic
             regular expressions (BRE's).  The re_format(7) manual page fully
             describes both formats.

     -iname pattern
             Like -name, but the match is case insensitive.

     -ipath pattern
             Like -path, but the match is case insensitive.

     -regex pattern
             True if the whole path of the file matches pattern using regular
             expression.  To match a file named ``./foo/xyzzy'', you can use
             the regular expression ``.*/[xyz]*'' or ``.*/foo/.*'', but not
             ``xyzzy'' or ``/foo/''.

     -iregex pattern
             Like -regex, but the match is case insensitive.

These are meant to be compatible with other find(1) implementations
such as GNU's or NetBSD's except regexp library differences.

Reviewed by:	sobomax, dcs, and some other people on -current
2001-02-23 16:20:55 +00:00
ru
b1c3961564 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
peter
5248b99d8f Add the -empty flag, from OpenBSD. It returns true if the directory
is empty.  There doesn't appear to be another easy way to do this.

mobile# mkdir foo
mobile# mkdir foo/bar
mobile# mkdir bar
mobile# find . -empty
./foo/bar
./bar
2001-01-23 11:16:50 +00:00
ru
b1e891e706 Prepare for mdoc(7)NG. 2001-01-16 09:39:23 +00:00
ru
655e7db87e Prepare for mdoc(7)NG. 2000-12-19 16:00:12 +00:00
ru
0957874304 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
mph
c8d4ff2f01 "minute(s) period(s)" --> "minute(s)" 2000-11-17 23:08:03 +00:00
eivind
ac212e8e66 Make passing unknown fstypes to -fstype result in a warning instead of
an error.  As it was, which find command lines that would work (be
accepted at all) was dependent on the presently running kernel, making
script writing and porting hard.
2000-07-28 20:02:42 +00:00
joe
d38d9a6248 Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
roberto
e7612a58f7 Make find -Wall -Wredundant-decls clean.
Submitted by:	nrahlstr
2000-06-14 07:43:52 +00:00
roberto
95ba1f5a9c This patch adds the -mindepth and -maxdepth options to find(1), which
behave as in GNU find (and of course as described in the manual page
    diff included).  I think these options would be useful for some people.

    Some missing $FreeBSD$ tags are also added.

    The patch was slightly modified (send-pr mangling of TABS).

PR:		bin/18941
Submitted by:	Ben Smithurst <ben@scientia.demon.co.uk>
2000-06-12 11:12:41 +00:00
roberto
5504118e77 The find -perm option currently supports an exact match,
or if the mode is preceded by a '-', it checks for a match
        in at least the bits specified on the command line.  It is
        often desirable to find things with any execute or setuid or
        setgid bits set.

PR:		bin/10169
Submitted by:	Monte Mitzelfelt <monte@gonefishing.org>
2000-06-12 10:36:52 +00:00
nik
737d2463e5 Fix errors in .Xr usage.
PR:             docs/17057
Submitted by:   Submitted by:   Udo Erdelhoff <ue@nathan.ruhr.de>
2000-03-01 10:48:35 +00:00