bug#79184: base32/base64: different behavior of -d with invalid input

Daniel Hofstetter <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <CAFRQvFrhCg18zABxQbSxxhdcJ-_3seYg=oUe=wwTF_VjTtP4SQ@mail.gmail.com>
Hi,

I noticed some inconsistency in how base32 and base64 handle invalid
input when decoding.

base32 simply shows an error on stderr whereas base64 shows an error
on stderr plus some output on stdout.

$ echo 'invalid' | base32 -d 2> /dev/null
$ echo 'invalid' | base32 -d > /dev/null
base32: invalid input
$ echo 'invalid' | base64 -d 2> /dev/null
�{ږ'$
$ echo 'invalid' | base64 -d > /dev/null
base64: invalid input

I'm using coreutils 9.7.

Regards,
Daniel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.