Add a new helper functions for _{flatten,get}_array
Add a new helper functions for _{flatten,get}_array

A new helper function (_array_helper) since both, the _flatten_array and
_get_array function share partially the same code.
We also reduce multiple whitespace to a single space, remove leading newlines
as well as skipping "empty" lines.

This makes the data returned by _{flatten,get}_array much nicer than before.
It also fixes bug 366677 where net-tools having trouble with the whitespace
mentioned above. iproute2 was not affected.

Reported-by: Andrew Maltsev <96e8155732e8324ae26f64d4516eb6fe696ac84f@ejelta.com>
X-Gentoo-Bug: 366677
X-Gentoo-Bug-URL: https://bugs.gentoo.org/366677

dwfreed/openrc,williamh/openrc,dwfreed/openrc,dwfreed/openrc,OpenRC/openrc,williamh/openrc,OpenRC/openrc,OpenRC/openrc,williamh/openrc