grep: add proper support for pattern_list

From POSIX.1-2008:

	The pattern_list's value shall consist of one or more patterns
	separated by <newline> characters;

As such, given patterns need to be split at newline characters. Without
doing so, busybox grep will interpret the newline as part of the pattern
which is not in accordance with POSIX.

See also:

Signed-off-by: Denys Vlasenko <>
2 files changed