Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/grep/grep.c
Show First 20 Lines • Show All 726 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
if (lbflag) | if (lbflag) | ||||
setlinebuf(stdout); | setlinebuf(stdout); | ||||
if ((aargc == 0 || aargc == 1) && !Hflag) | if ((aargc == 0 || aargc == 1) && !Hflag) | ||||
hflag = true; | hflag = true; | ||||
if (aargc == 0) | if (aargc == 0 && dirbehave != DIR_RECURSE) | ||||
cem: Help me understand this change :-). What's happening here? | |||||
Done Inline ActionsI think the latter part of this addition was some cruft that snuck in from something else I was playing with. I can't imagine, looking over this again, why this can't just be aargc == 0 && dirbehave != DIR_RECURSE, because the intention at this point is really just to let it get to grep_tree without specifying a file, then grep_tree handles the case where aargv does not contain a file. This will go away shortly. kevans: I think the latter part of this addition was some cruft that snuck in from something else I was… | |||||
exit(!procfile("-")); | exit(!procfile("-")); | ||||
if (dirbehave == DIR_RECURSE) | if (dirbehave == DIR_RECURSE) | ||||
c = grep_tree(aargv); | c = grep_tree(aargv); | ||||
else | else | ||||
for (c = 0; aargc--; ++aargv) { | for (c = 0; aargc--; ++aargv) { | ||||
if ((finclude || fexclude) && !file_matching(*aargv)) | if ((finclude || fexclude) && !file_matching(*aargv)) | ||||
continue; | continue; | ||||
Show All 11 Lines |
Help me understand this change :-). What's happening here?