From ben@scientia.demon.co.uk  Thu Jun  1 05:47:44 2000
Return-Path: <ben@scientia.demon.co.uk>
Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13])
	by hub.freebsd.org (Postfix) with ESMTP id 09DAA37B92B
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 Jun 2000 05:47:38 -0700 (PDT)
	(envelope-from ben@scientia.demon.co.uk)
Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=exim)
	by scientia.demon.co.uk with esmtp (Exim 3.12 #1)
	id 12xU2t-0003q7-00 for FreeBSD-gnats-submit@freebsd.org;
	Thu, 01 Jun 2000 13:25:55 +0100
Received: (from ben) by strontium.scientia.demon.co.uk (Exim 3.12 #7)
	id 12xU2s-0001ua-00 for FreeBSD-gnats-submit@freebsd.org;
	Thu, 01 Jun 2000 13:25:54 +0100
Message-Id: <E12xU2s-0001ua-00@strontium.scientia.demon.co.uk>
Date: Thu, 01 Jun 2000 13:25:54 +0100
From: Ben Smithurst <ben@scientia.demon.co.uk>
Reply-To: ben@scientia.demon.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Subject: Adding -{min,max}depth options to find(1)
X-Send-Pr-Version: 3.2

>Number:         18941
>Category:       bin
>Synopsis:       Adding -{min,max}depth options to find(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    roberto
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 01 05:50:06 PDT 2000
>Closed-Date:    Mon Jun 12 04:12:48 PDT 2000
>Last-Modified:  Mon Jun 12 04:13:22 PDT 2000
>Originator:     Ben Smithurst
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
>Environment:

>Description:

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.

I posted this patch on -hackers a month or two ago; there was only
response from kris (something like "good idea, but I haven't reviewed
the patch") so I thought I'd send-pr it.

>How-To-Repeat:

>Fix:

Index: extern.h
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/extern.h,v
retrieving revision 1.9
diff -u -r1.9 extern.h
--- extern.h	1999/12/19 15:43:18	1.9
+++ extern.h	2000/04/30 02:03:36
@@ -80,9 +80,12 @@
 PLAN	*c_xdev __P((void));
 PLAN	*c_openparen __P((void));
 PLAN	*c_closeparen __P((void));
+PLAN	*c_maxdepth __P((char *));
+PLAN	*c_mindepth __P((char *));
 PLAN	*c_mmin __P((char *));
 PLAN	*c_mtime __P((char *));
 PLAN	*c_not __P((void));
 PLAN	*c_or __P((void));
 
-extern int ftsoptions, isdeprecated, isdepth, isoutput, issort, isxargs;
+extern int ftsoptions, isdeprecated, isdepth, isoutput, issort, isxargs,
+    mindepth, maxdepth;
Index: find.1
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/find.1,v
retrieving revision 1.23
diff -u -r1.23 find.1
--- find.1	2000/03/01 10:48:32	1.23
+++ find.1	2000/04/28 19:48:12
@@ -245,6 +245,12 @@
 If the file is a symbolic link, the pathname of the linked\-to file will be
 displayed preceded by ``\->''.
 The format is identical to that produced by ``ls \-dgils''.
+.It Ic -maxdepth Ar n
+True if the depth of the current file into the tree is less than or equal to
+.Ar n .
+.It Ic -mindepth Ar n
+True if the depth of the current file into the tree is greater than or equal to
+.Ar n .
 .It Ic -mmin Ar n 
 True if the difference between the file last modification time and the time
 .Nm find
Index: find.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/find.c,v
retrieving revision 1.7
diff -u -r1.7 find.c
--- find.c	1998/11/29 11:34:30	1.7
+++ find.c	2000/04/30 02:43:35
@@ -35,7 +35,9 @@
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)find.c	8.5 (Berkeley) 8/5/94";
+static const char sccsid[] = "@(#)find.c	8.5 (Berkeley) 8/5/94";
+static const char rcsid[] =
+	"$FreeBSD$";
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -206,12 +208,21 @@
 			continue;
 		}
 
+		if (mindepth != -1 && entry->fts_level < mindepth)
+			continue;
+
 		/*
 		 * Call all the functions in the execution plan until one is
 		 * false or all have been executed.  This is where we do all
 		 * the work specified by the user on the command line.
 		 */
 		for (p = plan; p && (p->eval)(p, entry); p = p->next);
+
+		if (maxdepth != -1 && entry->fts_level >= maxdepth) {
+			if (fts_set(tree, entry, FTS_SKIP))
+				err(1, "%s", entry->fts_path);
+			continue;
+		}
 	}
 	if (errno)
 		err(1, "fts_read");
Index: find.h
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/find.h,v
retrieving revision 1.6
diff -u -r1.6 find.h
--- find.h	1999/12/19 15:43:18	1.6
+++ find.h	2000/04/28 19:44:31
@@ -46,7 +46,7 @@
         N_MTIME, N_NAME,
 	N_NEWER, N_NOGROUP, N_NOT, N_NOUSER, N_OK, N_OPENPAREN, N_OR, N_PATH,
 	N_PERM, N_PRINT, N_PRUNE, N_SIZE, N_TYPE, N_USER, N_XDEV,
-	N_PRINT0, N_DELETE
+	N_PRINT0, N_DELETE, N_MAXDEPTH, N_MINDEPTH
 };
 
 /* node definition */
Index: function.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/function.c,v
retrieving revision 1.22
diff -u -r1.22 function.c
--- function.c	2000/02/05 18:42:34	1.22
+++ function.c	2000/04/30 02:16:30
@@ -35,8 +35,9 @@
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)function.c	8.10 (Berkeley) 5/4/95";
-static char rcsid[] = "$FreeBSD: src/usr.bin/find/function.c,v 1.22 2000/02/05 18:42:34 joe Exp $";
+static const char sccsid[] = "@(#)function.c	8.10 (Berkeley) 5/4/95";
+static const char rcsid[] =
+	"$FreeBSD: src/usr.bin/find/function.c,v 1.22 2000/02/05 18:42:34 joe Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -717,6 +718,68 @@
 }
 
 /*
+ * -maxdepth n functions --
+ *
+ *	Does the same as -prune if the level of the current file is greater
+ *	than the specified maximum depth.
+ *
+ *	Note that -maxdepth and -mindepth are handled specially in
+ *	find_execute() so their f_* functions here do nothing.
+ */
+int
+f_maxdepth(plan, entry)
+	PLAN *plan;
+	FTSENT *entry;
+{
+	return (1);
+}
+
+PLAN *
+c_maxdepth(arg)
+	char *arg;
+{
+	PLAN *new;
+
+	if (*arg == '-')
+		/* all other errors handled by find_parsenum() */
+		errx(1, "-maxdepth: %s: value must be positive", arg);
+
+	new = palloc(N_MAXDEPTH, f_maxdepth);
+	maxdepth = find_parsenum(new, "-maxdepth", arg, NULL);
+	return (new);
+
+}
+
+/*
+ * -mindepth n functions --
+ *
+ *	True if the current file is at or deeper than the specified minimum
+ *	depth.
+ */
+int
+f_mindepth(plan, entry)
+	PLAN *plan;
+	FTSENT *entry;
+{
+	return (1);
+}
+
+PLAN *
+c_mindepth(arg)
+	char *arg;
+{
+	PLAN *new;
+
+	if (*arg == '-')
+		/* all other errors handled by find_parsenum() */
+		errx(1, "-maxdepth: %s: value must be positive", arg);
+
+	new = palloc(N_MINDEPTH, f_mindepth);
+	mindepth = find_parsenum(new, "-mindepth", arg, NULL);
+	return (new);
+}
+
+/*
  * -mtime n functions --
  *
  *	True if the difference between the file modification time and the
@@ -1005,9 +1068,6 @@
 #endif
 	return new;
 }
-  
-  /*
-
 
 /*
  * -print functions --
Index: ls.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/ls.c,v
retrieving revision 1.5
diff -u -r1.5 ls.c
--- ls.c	1998/07/06 21:01:14	1.5
+++ ls.c	2000/04/30 02:18:13
@@ -32,7 +32,9 @@
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)ls.c	8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)ls.c	8.1 (Berkeley) 6/6/93";
+static const char rcsid[] =
+	"$FreeBSD$";
 #endif /* not lint */
 
 #include <sys/param.h>
Index: main.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/main.c,v
retrieving revision 1.9
diff -u -r1.9 main.c
--- main.c	1998/11/29 11:34:30	1.9
+++ main.c	2000/04/30 02:18:17
@@ -41,7 +41,9 @@
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c	8.4 (Berkeley) 5/4/95";
+static const char sccsid[] = "@(#)main.c	8.4 (Berkeley) 5/4/95";
+static const char rcsid[] =
+	"$FreeBSD$";
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -67,6 +69,7 @@
 int isoutput;			/* user specified output operator */
 int issort;         		/* do hierarchies in lexicographical order */
 int isxargs;			/* don't permit xargs delimiting chars */
+int mindepth = -1, maxdepth = -1; /* minimum and maximum depth */
 
 static void usage __P((void));
 
Index: misc.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/misc.c,v
retrieving revision 1.2
diff -u -r1.2 misc.c
--- misc.c	1995/05/30 06:30:13	1.2
+++ misc.c	2000/04/30 02:18:20
@@ -35,7 +35,9 @@
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c	8.2 (Berkeley) 4/1/94";
+static const char sccsid[] = "@(#)misc.c	8.2 (Berkeley) 4/1/94";
+static const char rcsid[] =
+	"$FreeBSD$";
 #endif /* not lint */
 
 #include <sys/types.h>
Index: operator.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/operator.c,v
retrieving revision 1.5
diff -u -r1.5 operator.c
--- operator.c	1998/11/29 12:17:09	1.5
+++ operator.c	2000/04/30 02:18:23
@@ -35,7 +35,9 @@
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)operator.c	8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)operator.c	8.1 (Berkeley) 6/6/93";
+static const char rcsid[] =
+	"$FreeBSD$";
 #endif /* not lint */
 
 #include <sys/types.h>
Index: option.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/find/option.c,v
retrieving revision 1.9
diff -u -r1.9 option.c
--- option.c	1999/12/19 15:43:19	1.9
+++ option.c	2000/04/30 02:18:28
@@ -84,6 +84,8 @@
 	{ "-inum",	N_INUM,		c_inum,		O_ARGV },
 	{ "-links",	N_LINKS,	c_links,	O_ARGV },
 	{ "-ls",	N_LS,		c_ls,		O_ZERO },
+	{ "-maxdepth",	N_MAXDEPTH,	c_maxdepth,	O_ARGV },
+	{ "-mindepth",	N_MINDEPTH,	c_mindepth,	O_ARGV },
 	{ "-mmin",	N_MMIN,	        c_mmin,	        O_ARGV },
 	{ "-mtime",	N_MTIME,	c_mtime,	O_ARGV },
 	{ "-name",	N_NAME,		c_name,		O_ARGV },

>Release-Note:
>Audit-Trail:

From: Bill Fumerola <billf@chc-chimes.com>
To: Ben Smithurst <ben@scientia.demon.co.uk>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/18941: Adding -{min,max}depth options to find(1)
Date: Thu, 1 Jun 2000 10:47:20 -0400

 On Thu, Jun 01, 2000 at 01:25:54PM +0100, Ben Smithurst wrote:
 > 
 
 > @@ -35,7 +35,9 @@
 >   */
 >  
 >  #ifndef lint
 > -static char sccsid[] = "@(#)find.c	8.5 (Berkeley) 8/5/94";
 > +static const char sccsid[] = "@(#)find.c	8.5 (Berkeley) 8/5/94";
 > +static const char rcsid[] =
 > +	"$FreeBSD$";
 >  #endif /* not lint */
 
 all of these deltas like this should look something like:
 
 #if 0
 static char sccsid[] = "blah..";
 #else
 static const char rcsid[] = 
   "$FreeBSD$";
 #endif
 
 or something similar.
 </minibde>
 
 -- 
 Bill Fumerola - Network Architect / Computer Horizons Corp - CVM
 e-mail: billf@chc-chimes.com / billf@FreeBSD.org
 
 
 
 

From: Ben Smithurst <ben@scientia.demon.co.uk>
To: Bill Fumerola <billf@chc-chimes.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/18941: Adding -{min,max}depth options to find(1)
Date: Thu, 1 Jun 2000 17:33:03 +0100

 Bill Fumerola wrote:
 
 > all of these deltas like this should look something like:
 > 
 > #if 0
 > static char sccsid[] = "blah..";
 > #else
 > static const char rcsid[] = 
 >   "$FreeBSD$";
 > #endif
 
 ok.  Should the #ifndef lint around it all stay?
 
 -- 
 Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D
 

From: Bill Fumerola <billf@chc-chimes.com>
To: Ben Smithurst <ben@scientia.demon.co.uk>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/18941: Adding -{min,max}depth options to find(1)
Date: Thu, 1 Jun 2000 15:12:42 -0400

 On Thu, Jun 01, 2000 at 05:33:03PM +0100, Ben Smithurst wrote:
 
 > > #if 0
 > > static char sccsid[] = "blah..";
 > > #else
 > > static const char rcsid[] = 
 > >   "$FreeBSD$";
 > > #endif
 > 
 > ok.  Should the #ifndef lint around it all stay?
 
 yes
 
 -- 
 Bill Fumerola - Network Architect / Computer Horizons Corp - CVM
 e-mail: billf@chc-chimes.com / billf@FreeBSD.org
 
 
 
 

From: Ben Smithurst <ben@scientia.demon.co.uk>
To: Bill Fumerola <billf@chc-chimes.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/18941: Adding -{min,max}depth options to find(1)
Date: Fri, 2 Jun 2000 21:53:04 +0100

 --4SFOXa2GPu3tIq4H
 Content-Type: text/plain; charset=us-ascii
 
 Bill Fumerola wrote:
 
 > On Thu, Jun 01, 2000 at 05:33:03PM +0100, Ben Smithurst wrote:
 > 
 >> ok.  Should the #ifndef lint around it all stay?
 > 
 > yes
 
 ok, here's an updated diff.
 
 -- 
 Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D
 
 --4SFOXa2GPu3tIq4H
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="find.diff"
 
 Index: Makefile
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/Makefile,v
 retrieving revision 1.8
 diff -u -r1.8 Makefile
 --- Makefile	2000/02/05 18:42:34	1.8
 +++ Makefile	2000/06/01 16:36:09
 @@ -1,6 +1,7 @@
  #	@(#)Makefile	8.1 (Berkeley) 6/6/93
  # $FreeBSD: src/usr.bin/find/Makefile,v 1.8 2000/02/05 18:42:34 joe Exp $
  
 +CFLAGS+=	-Wall
  PROG=	find
  SRCS=	find.c function.c ls.c main.c misc.c operator.c option.c setflags.c
  .PATH:	${.CURDIR}/../../lib/libc/gen
 Index: extern.h
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/extern.h,v
 retrieving revision 1.9
 diff -u -r1.9 extern.h
 --- extern.h	1999/12/19 15:43:18	1.9
 +++ extern.h	2000/04/30 02:03:36
 @@ -80,9 +80,12 @@
  PLAN	*c_xdev __P((void));
  PLAN	*c_openparen __P((void));
  PLAN	*c_closeparen __P((void));
 +PLAN	*c_maxdepth __P((char *));
 +PLAN	*c_mindepth __P((char *));
  PLAN	*c_mmin __P((char *));
  PLAN	*c_mtime __P((char *));
  PLAN	*c_not __P((void));
  PLAN	*c_or __P((void));
  
 -extern int ftsoptions, isdeprecated, isdepth, isoutput, issort, isxargs;
 +extern int ftsoptions, isdeprecated, isdepth, isoutput, issort, isxargs,
 +    mindepth, maxdepth;
 Index: find.1
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/find.1,v
 retrieving revision 1.23
 diff -u -r1.23 find.1
 --- find.1	2000/03/01 10:48:32	1.23
 +++ find.1	2000/04/28 19:48:12
 @@ -245,6 +245,12 @@
  If the file is a symbolic link, the pathname of the linked\-to file will be
  displayed preceded by ``\->''.
  The format is identical to that produced by ``ls \-dgils''.
 +.It Ic -maxdepth Ar n
 +True if the depth of the current file into the tree is less than or equal to
 +.Ar n .
 +.It Ic -mindepth Ar n
 +True if the depth of the current file into the tree is greater than or equal to
 +.Ar n .
  .It Ic -mmin Ar n 
  True if the difference between the file last modification time and the time
  .Nm find
 Index: find.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/find.c,v
 retrieving revision 1.7
 diff -u -r1.7 find.c
 --- find.c	1998/11/29 11:34:30	1.7
 +++ find.c	2000/06/01 16:33:29
 @@ -35,7 +35,12 @@
   */
  
  #ifndef lint
 +#if 0
  static char sccsid[] = "@(#)find.c	8.5 (Berkeley) 8/5/94";
 +#else
 +static const char rcsid[] =
 +	"$FreeBSD$";
 +#endif
  #endif /* not lint */
  
  #include <sys/types.h>
 @@ -206,12 +211,21 @@
  			continue;
  		}
  
 +		if (mindepth != -1 && entry->fts_level < mindepth)
 +			continue;
 +
  		/*
  		 * Call all the functions in the execution plan until one is
  		 * false or all have been executed.  This is where we do all
  		 * the work specified by the user on the command line.
  		 */
  		for (p = plan; p && (p->eval)(p, entry); p = p->next);
 +
 +		if (maxdepth != -1 && entry->fts_level >= maxdepth) {
 +			if (fts_set(tree, entry, FTS_SKIP))
 +				err(1, "%s", entry->fts_path);
 +			continue;
 +		}
  	}
  	if (errno)
  		err(1, "fts_read");
 Index: find.h
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/find.h,v
 retrieving revision 1.6
 diff -u -r1.6 find.h
 --- find.h	1999/12/19 15:43:18	1.6
 +++ find.h	2000/04/28 19:44:31
 @@ -46,7 +46,7 @@
          N_MTIME, N_NAME,
  	N_NEWER, N_NOGROUP, N_NOT, N_NOUSER, N_OK, N_OPENPAREN, N_OR, N_PATH,
  	N_PERM, N_PRINT, N_PRUNE, N_SIZE, N_TYPE, N_USER, N_XDEV,
 -	N_PRINT0, N_DELETE
 +	N_PRINT0, N_DELETE, N_MAXDEPTH, N_MINDEPTH
  };
  
  /* node definition */
 Index: function.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/function.c,v
 retrieving revision 1.22
 diff -u -r1.22 function.c
 --- function.c	2000/02/05 18:42:34	1.22
 +++ function.c	2000/06/01 16:33:45
 @@ -35,8 +35,12 @@
   */
  
  #ifndef lint
 +#if 0
  static char sccsid[] = "@(#)function.c	8.10 (Berkeley) 5/4/95";
 -static char rcsid[] = "$FreeBSD: src/usr.bin/find/function.c,v 1.22 2000/02/05 18:42:34 joe Exp $";
 +#else
 +static const char rcsid[] =
 +	"$FreeBSD: src/usr.bin/find/function.c,v 1.22 2000/02/05 18:42:34 joe Exp $";
 +#endif
  #endif /* not lint */
  
  #include <sys/param.h>
 @@ -717,6 +721,68 @@
  }
  
  /*
 + * -maxdepth n functions --
 + *
 + *	Does the same as -prune if the level of the current file is greater
 + *	than the specified maximum depth.
 + *
 + *	Note that -maxdepth and -mindepth are handled specially in
 + *	find_execute() so their f_* functions here do nothing.
 + */
 +int
 +f_maxdepth(plan, entry)
 +	PLAN *plan;
 +	FTSENT *entry;
 +{
 +	return (1);
 +}
 +
 +PLAN *
 +c_maxdepth(arg)
 +	char *arg;
 +{
 +	PLAN *new;
 +
 +	if (*arg == '-')
 +		/* all other errors handled by find_parsenum() */
 +		errx(1, "-maxdepth: %s: value must be positive", arg);
 +
 +	new = palloc(N_MAXDEPTH, f_maxdepth);
 +	maxdepth = find_parsenum(new, "-maxdepth", arg, NULL);
 +	return (new);
 +
 +}
 +
 +/*
 + * -mindepth n functions --
 + *
 + *	True if the current file is at or deeper than the specified minimum
 + *	depth.
 + */
 +int
 +f_mindepth(plan, entry)
 +	PLAN *plan;
 +	FTSENT *entry;
 +{
 +	return (1);
 +}
 +
 +PLAN *
 +c_mindepth(arg)
 +	char *arg;
 +{
 +	PLAN *new;
 +
 +	if (*arg == '-')
 +		/* all other errors handled by find_parsenum() */
 +		errx(1, "-maxdepth: %s: value must be positive", arg);
 +
 +	new = palloc(N_MINDEPTH, f_mindepth);
 +	mindepth = find_parsenum(new, "-mindepth", arg, NULL);
 +	return (new);
 +}
 +
 +/*
   * -mtime n functions --
   *
   *	True if the difference between the file modification time and the
 @@ -1005,9 +1071,6 @@
  #endif
  	return new;
  }
 -  
 -  /*
 -
  
  /*
   * -print functions --
 Index: ls.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/ls.c,v
 retrieving revision 1.5
 diff -u -r1.5 ls.c
 --- ls.c	1998/07/06 21:01:14	1.5
 +++ ls.c	2000/06/01 16:34:27
 @@ -32,7 +32,12 @@
   */
  
  #ifndef lint
 +#if 0
  static char sccsid[] = "@(#)ls.c	8.1 (Berkeley) 6/6/93";
 +#else
 +static const char rcsid[] =
 +	"$FreeBSD$";
 +#endif
  #endif /* not lint */
  
  #include <sys/param.h>
 Index: main.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/main.c,v
 retrieving revision 1.9
 diff -u -r1.9 main.c
 --- main.c	1998/11/29 11:34:30	1.9
 +++ main.c	2000/06/01 16:34:36
 @@ -41,7 +41,12 @@
  #endif /* not lint */
  
  #ifndef lint
 +#if 0
  static char sccsid[] = "@(#)main.c	8.4 (Berkeley) 5/4/95";
 +#else
 +static const char rcsid[] =
 +	"$FreeBSD$";
 +#endif
  #endif /* not lint */
  
  #include <sys/types.h>
 @@ -67,6 +72,7 @@
  int isoutput;			/* user specified output operator */
  int issort;         		/* do hierarchies in lexicographical order */
  int isxargs;			/* don't permit xargs delimiting chars */
 +int mindepth = -1, maxdepth = -1; /* minimum and maximum depth */
  
  static void usage __P((void));
  
 Index: misc.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/misc.c,v
 retrieving revision 1.2
 diff -u -r1.2 misc.c
 --- misc.c	1995/05/30 06:30:13	1.2
 +++ misc.c	2000/06/01 16:34:46
 @@ -35,7 +35,12 @@
   */
  
  #ifndef lint
 +#if 0
  static char sccsid[] = "@(#)misc.c	8.2 (Berkeley) 4/1/94";
 +#else
 +static const char rcsid[] =
 +	"$FreeBSD$";
 +#endif
  #endif /* not lint */
  
  #include <sys/types.h>
 Index: operator.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/operator.c,v
 retrieving revision 1.5
 diff -u -r1.5 operator.c
 --- operator.c	1998/11/29 12:17:09	1.5
 +++ operator.c	2000/06/01 16:34:57
 @@ -35,7 +35,12 @@
   */
  
  #ifndef lint
 +#if 0
  static char sccsid[] = "@(#)operator.c	8.1 (Berkeley) 6/6/93";
 +#else
 +static const char rcsid[] =
 +	"$FreeBSD$";
 +#endif
  #endif /* not lint */
  
  #include <sys/types.h>
 Index: option.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.bin/find/option.c,v
 retrieving revision 1.9
 diff -u -r1.9 option.c
 --- option.c	1999/12/19 15:43:19	1.9
 +++ option.c	2000/04/30 02:18:28
 @@ -84,6 +84,8 @@
  	{ "-inum",	N_INUM,		c_inum,		O_ARGV },
  	{ "-links",	N_LINKS,	c_links,	O_ARGV },
  	{ "-ls",	N_LS,		c_ls,		O_ZERO },
 +	{ "-maxdepth",	N_MAXDEPTH,	c_maxdepth,	O_ARGV },
 +	{ "-mindepth",	N_MINDEPTH,	c_mindepth,	O_ARGV },
  	{ "-mmin",	N_MMIN,	        c_mmin,	        O_ARGV },
  	{ "-mtime",	N_MTIME,	c_mtime,	O_ARGV },
  	{ "-name",	N_NAME,		c_name,		O_ARGV },
 
 --4SFOXa2GPu3tIq4H--
 
Responsible-Changed-From-To: freebsd-bugs->roberto 
Responsible-Changed-By: nrahlstr 
Responsible-Changed-When: Mon Jun 5 21:56:26 PDT 2000 
Responsible-Changed-Why:  
Ollivier has kindly agreed to look over find(1) related PR's. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=18941 
State-Changed-From-To: open->closed 
State-Changed-By: roberto 
State-Changed-When: Mon Jun 12 04:12:48 PDT 2000 
State-Changed-Why:  
Patch applied after tabs unmangling. Thanks! 


http://www.freebsd.org/cgi/query-pr.cgi?pr=18941 
>Unformatted:
