textonly: clean up the base64 decoder

Let's put the decoder into its own function. It counts input bytes and
output bits. Note that the state (bits and bytes) could even be stored
in the upper bits of the current word (5 bits for #bits and 2 bits for
 #bytes) but that's pointless here, so let's stay simple. At least now
we can ignore non-base64 chars so the converter is more robust (may
skip spaces/tabs/cr/lf for example).
1 file changed