grep: Move lone 'r'grep case into the adjacent switch

This 'r' case should have belonged to the switch in the first place, but
I had somehow missed the switch when initially adding the rgrep link. The
zgrep script later came along and faithfully left this case standing alone,
so we will now go ahead and join it.

Nearby comment also adjusted a tad bit for wording and style.

Reported by:	Daniel Ebdrup
MFC after:	3 days
This commit is contained in:
Kyle Evans 2019-06-02 02:38:44 +00:00
parent d842aa5114
commit 25385eb325

View File

@ -343,14 +343,12 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
/* Check what is the program name of the binary. In this
way we can have all the funcionalities in one binary
without the need of scripting and using ugly hacks. */
/*
* Check how we've bene invoked to determine the behavior we should
* exhibit. In this way we can have all the functionalities in one
* binary without the need of scripting and using ugly hacks.
*/
pn = getprogname();
if (pn[0] == 'r') {
dirbehave = DIR_RECURSE;
Hflag = true;
}
switch (pn[0]) {
case 'e':
grepbehave = GREP_EXTENDED;
@ -358,6 +356,10 @@ main(int argc, char *argv[])
case 'f':
grepbehave = GREP_FIXED;
break;
case 'r':
dirbehave = DIR_RECURSE;
Hflag = true;
break;
}
lastc = '\0';