diff options
author | 1997-06-17 05:35:44 +0000 | |
---|---|---|
committer | 1997-06-17 05:35:44 +0000 | |
commit | dc8aa1d0a96a8d68c6f82a1d3a9fecc074055c5e (patch) | |
tree | aabf9291f031cd5c54fcf21ebfdffcff1ea0bddf | |
parent | Add per-interface binding, based on der Mouse's code in netbsd. (diff) | |
download | wireguard-openbsd-dc8aa1d0a96a8d68c6f82a1d3a9fecc074055c5e.tar.xz wireguard-openbsd-dc8aa1d0a96a8d68c6f82a1d3a9fecc074055c5e.zip |
If no paths are specified, use "."
-rw-r--r-- | usr.bin/find/find.1 | 5 | ||||
-rw-r--r-- | usr.bin/find/main.c | 11 |
2 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index 45145d77a23..6f470a46e8b 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: find.1,v 1.10 1996/12/23 04:58:09 millert Exp $ +.\" $OpenBSD: find.1,v 1.11 1997/06/17 05:35:44 millert Exp $ .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -54,7 +54,8 @@ recursively descends the directory tree for each listed, evaluating an .Ar expression (composed of the ``primaries'' and ``operands'' listed below) in terms -of each file in the tree. +of each file in the tree. If no files are specified, the current +directory is used. .Pp The options are as follows: .Pp diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c index 35d01cd371e..0bcd42a4e6c 100644 --- a/usr.bin/find/main.c +++ b/usr.bin/find/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.5 1997/06/17 05:26:17 millert Exp $ */ +/* $OpenBSD: main.c,v 1.6 1997/06/17 05:35:44 millert Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -35,7 +35,7 @@ #ifndef lint /*static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: main.c,v 1.5 1997/06/17 05:26:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.6 1997/06/17 05:35:44 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -73,7 +73,7 @@ main(argc, argv) (void)time(&now); /* initialize the time-of-day */ - p = paths = (char **) emalloc(sizeof(char *) * argc); + p = paths = (char **) emalloc(sizeof(char *) * (argc > 1 ? argc : 2)); sigaction(SIGINFO, &sa, NULL); @@ -119,9 +119,10 @@ main(argc, argv) *p++ = *argv++; } + if (p == paths) + *p++ = "."; /* use cwd if no dir specified */ *p = NULL; - if (paths[0] == NULL) /* we must have at least one path */ - usage(); + if (!(paths = realloc(paths, sizeof(char *) * (p - paths + 1)))) err(1, NULL); |