Bruno Haible <br...@clisp.org> writes:

> Jim Meyering wrote:
>> >  Could also be done, but since the code to remove newlines was there, I
>> > thought it is simpler to augment it to remove common garbage.
>> 
>> I am reluctant to make this low-level decoding function ignore anything
>> else.
>
> I agree. If you remove the garbage unconditionally, you have lost the
> functionality of doing strict checking of the input. If you add a 'bool'
> parameter that determines whether the remove it, you have added complexity
> in the interface (.h file) for nearly nothing.

I agree too -- there are situations where you really don't want to
ignore non-alphabetic characters.  Pre-filtering seems like the right
thing here.

Possibly, the base64 module could provide a separate function for doing
this pre-filtering though?  That doesn't add significant complexity to
the code, but it makes it easy for callers to use.

/Simon

Reply via email to