summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-12-20 16:15:27 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-12-20 16:15:27 +0000
commitedf8e04dd74bb31e4d5a5e1e252c605fd120c8e3 (patch)
tree59e3e90684c3105287c053d6260cd135aa471089
parenta6f46949f164c471ac5e8dbde642a433d32a4148 (diff)
find -LH was -L, but must be -H according to POSIX;
patch from Daniel Dickman <didickman at gmail dot com> via tech@, though i'm updating the manual in a different way; ok millert@ "looks good" deraadt@
-rw-r--r--usr.bin/find/find.110
-rw-r--r--usr.bin/find/main.c5
2 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1
index 139ec94000b..7cfcea29bde 100644
--- a/usr.bin/find/find.1
+++ b/usr.bin/find/find.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: find.1,v 1.74 2009/04/09 14:30:39 jmc Exp $
+.\" $OpenBSD: find.1,v 1.75 2009/12/20 16:15:26 schwarze Exp $
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -31,7 +31,7 @@
.\"
.\" from: @(#)find.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd $Mdocdate: April 9 2009 $
+.Dd $Mdocdate: December 20 2009 $
.Dt FIND 1
.Os
.Sh NAME
@@ -96,6 +96,9 @@ If the referenced file does not exist, the file information and type will
be for the link itself.
File information of all symbolic links not on
the command line is that of the link itself.
+This option overrides
+.Fl L
+given earlier on the command line.
.It Fl h
An alias for the
.Fl L
@@ -108,6 +111,9 @@ returned for each symbolic link to be those of the file referenced by the
link, not the link itself.
If the referenced file does not exist, the file information and type will
be for the link itself.
+This option overrides
+.Fl H
+given earlier on the command line.
.It Fl X
Permit
.Nm
diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c
index 48b2123c290..9bc52b4e3f7 100644
--- a/usr.bin/find/main.c
+++ b/usr.bin/find/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.25 2009/12/09 13:59:43 millert Exp $ */
+/* $OpenBSD: main.c,v 1.26 2009/12/20 16:15:26 schwarze Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -75,6 +75,8 @@ main(int argc, char *argv[])
switch(ch) {
case 'H':
ftsoptions |= FTS_COMFOLLOW;
+ ftsoptions |= FTS_PHYSICAL;
+ ftsoptions &= ~FTS_LOGICAL;
break;
case 'd':
isdepth = 1;
@@ -84,6 +86,7 @@ main(int argc, char *argv[])
break;
case 'h':
case 'L':
+ ftsoptions &= ~FTS_COMFOLLOW;
ftsoptions &= ~FTS_PHYSICAL;
ftsoptions |= FTS_LOGICAL;
break;