From edwin@mavetju.org  Fri Jul  9 06:09:53 2004
Return-Path: <edwin@mavetju.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5998616A4DB
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Jul 2004 06:09:53 +0000 (GMT)
Received: from mailout2.barnet.com.au (mailout2.barnet.com.au [218.185.88.16])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9C50C43D45
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Jul 2004 06:09:52 +0000 (GMT)
	(envelope-from edwin@mavetju.org)
Received: by mailout2.barnet.com.au (Postfix, from userid 27)
	id 1E35FAA622D; Fri,  9 Jul 2004 16:09:51 +1000 (EST)
Received: from mail2-auth.barnet.com.au (localhost [127.0.0.1])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "*.barnet.com.au", Issuer "BarNet Root Certificate Authority" (verified OK))
	by mail2.barnet.com.au (Postfix) with ESMTP id D8C9EB29D93
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Jul 2004 16:09:50 +1000 (EST)
Received: from k7.mavetju (unknown [10.10.12.2])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "edwin.adsl.barnet.com.au", Issuer "BarNet Root Certificate Authority" (verified OK))
	by mail2-auth.barnet.com.au (Postfix) with ESMTP id 22E3F1943F
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Jul 2004 16:09:50 +1000 (EST)
Received: by k7.mavetju (Postfix, from userid 1001)
	id 6D8DF60ED; Fri,  9 Jul 2004 16:09:48 +1000 (EST)
Message-Id: <20040709060948.6D8DF60ED@k7.mavetju>
Date: Fri,  9 Jul 2004 16:09:48 +1000 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] find(1) shows pathname as optional but it isn't.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         68848
>Category:       bin
>Synopsis:       [patch] find(1) shows pathname as optional but it isn't.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    stefanf
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 09 06:10:23 GMT 2004
>Closed-Date:    Thu Jun 07 21:06:56 GMT 2007
>Last-Modified:  Thu Jun 07 21:06:56 GMT 2007
>Originator:     Edwin Groothuis
>Release:        FreeBSD 5.2.1-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #3: Fri Feb 27 13:54:29 EST 2004 edwin@k7.mavetju:/usr/src/sys/i386/compile/k7 i386

>Description:
    Find(4) and its manpage say that the pathname is optional:

    [/usr/src/usr.bin/find] edwin@k7>find
    usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]
    [/usr/src/usr.bin/find] edwin@k7>man find
    find [-H | -L | -P] [-EXdsx] [-f pathname] [pathname ...] expression

    But I haven't figured out a way to get it running without the
    pathname and assume it isn't optional.

>How-To-Repeat:

    [/usr/src/usr.bin/find] root@k7>find -name test
    find: illegal option -- n
    [/usr/src/usr.bin/find] root@k7>find -- -name test
    usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]

    I think it's only fair to update the man page and the usage()
    of find(4).

>Fix:

--- find.1.orig Fri Jul  9 15:58:22 2004
+++ find.1      Fri Jul  9 15:58:32 2004
@@ -45,7 +45,7 @@
 .Op Fl H | Fl L | Fl P
 .Op Fl EXdsx
 .Op Fl f Ar pathname
-.Op Ar pathname ...
+.Ar pathname ...
 .Ar expression
 .Sh DESCRIPTION
 The

[/usr/src/usr.bin/find] root@k7>diff -u main.c.orig main.c
--- main.c.orig Fri Jul  9 15:58:53 2004
+++ main.c      Fri Jul  9 16:01:44 2004
@@ -164,6 +164,6 @@
 usage(void)
 {
        (void)fprintf(stderr,
-"usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]\n");
+"usage: find [-H | -L | -P] [-EXdsx] [-f pathname] pathname ... expression\n");
        exit(1);
 }

>Release-Note:
>Audit-Trail:

From: Stefan Farfeleder <stefanf@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/68848: [patch] find(1) shows pathname as optional but it isn't.
Date: Sun, 1 May 2005 23:28:04 +0200

 --hOcCNbCCxyk/YU74
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 There has to be at least one pathname, either given by -f or following
 the options.  Do you think the attached patch helps clarifying this?
 
 --hOcCNbCCxyk/YU74
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="find.1.diff"
 
 Index: find.1
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/find/find.1,v
 retrieving revision 1.72
 diff -I.svn -u -r1.72 find.1
 --- find.1	2 Apr 2005 07:44:12 -0000	1.72
 +++ find.1	1 May 2005 21:21:16 -0000
 @@ -46,6 +46,12 @@
  .Op Fl H | Fl L | Fl P
  .Op Fl EXdsx
  .Op Fl f Ar pathname
 +.Ar pathname ...
 +.Ar expression
 +.Nm
 +.Op Fl H | Fl L | Fl P
 +.Op Fl EXdsx
 +.Fl f Ar pathname
  .Op Ar pathname ...
  .Ar expression
  .Sh DESCRIPTION
 
 --hOcCNbCCxyk/YU74--
Responsible-Changed-From-To: freebsd-bugs->stefanf 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Jun 2 04:39:22 UTC 2007 
Responsible-Changed-Why:  
Please commit the patch you suggested. 
Thanks, Edwin 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68848 
State-Changed-From-To: open->closed 
State-Changed-By: stefanf 
State-Changed-When: Thu Jun 7 21:06:18 UTC 2007 
State-Changed-Why:  
It seems I already committed the patch last year (find.1 1.78). 

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