Permalink
Browse files

Do not grep directories when recursing

From des@freebsd.org:

--- util.c.orig	Tue Feb  3 13:36:42 2004
+++ util.c	Tue Feb  3 13:39:49 2004
@@ -72,10 +72,11 @@
 	while ((p = fts_read(fts)) != NULL) {
 		switch (p->fts_info) {
 		case FTS_DNR:
-			break;
+			/* FALL THROUGH */
 		case FTS_ERR:
 			errx(1, "%s: %s", p->fts_path, strerror(p->fts_errno));
 			break;
+		case FTS_D:
 		case FTS_DP:
 			break;
 		default:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/textproc/freegrep/files/patch-ab?rev=1.1
  • Loading branch information...
howardjp committed Jun 9, 2010
1 parent 32dcdc2 commit 881db8917a8ebbf4c25d7e51cca216c0e5a34b9d
Showing with 2 additions and 1 deletion.
  1. +2 −1 util.c
View
3 util.c
@@ -74,10 +74,11 @@ grep_tree(char **argv)
while ((p = fts_read(fts)) != NULL) {
switch (p->fts_info) {
case FTS_DNR:
- break;
+ /* FALL THROUGH */
case FTS_ERR:
errx(2, "%s: %s", p->fts_path, strerror(p->fts_errno));
break;
+ case FTS_D:
case FTS_DP:
break;
default:

0 comments on commit 881db89

Please sign in to comment.