From 382057f588fbf2c2f7950b85dd317721b8d04c07 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 21 Nov 2016 16:47:23 -0600 Subject: Have dirtree_notdotdot() pass through !node->parent so . and .. on the command line aren't filtered out. Audited all the callers and removed redundant calls, adjusted call sequence, etc. (And let rm _not_ do this, because posix.) --- toys/posix/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix/grep.c') diff --git a/toys/posix/grep.c b/toys/posix/grep.c index 2fe6ac27..a95203a0 100644 --- a/toys/posix/grep.c +++ b/toys/posix/grep.c @@ -313,7 +313,7 @@ static int do_grep_r(struct dirtree *new) { char *name; - if (new->parent && !dirtree_notdotdot(new)) return 0; + if (!dirtree_notdotdot(new)) return 0; if (S_ISDIR(new->st.st_mode)) return DIRTREE_RECURSE; // "grep -r onefile" doesn't show filenames, but "grep -r onedir" should. -- cgit v1.2.3