[ChangeLog]
commit3b933f1e33197fec6a59466df1337292ec7bfa56
authorJim Meyering <jim@meyering.net>
Thu, 4 Jan 2007 10:52:52 +0000 (4 11:52 +0100)
committerJim Meyering <jim@meyering.net>
Thu, 4 Jan 2007 10:52:52 +0000 (4 11:52 +0100)
tree407732a747d2622577c8366b93a01744dfa8845b
parent99d9e13b9c7e53db7620e5b34550a114adfa22d3
[ChangeLog]
When decoding, always allow newlines in input, with almost no
performance impact.
* src/base64.c (do_decode): Initialize decode context.
Call base64_decode one more time, after all input is processed.
(usage): When decoding, newlines are always accepted.

* tests/misc/base64: Add a bunch of tests, for the above.
* gl/lib/base64.c: Include <string.h>.
(base64_decode_ctx_init, get_4, decode_4): New functions.
(base64_decode): Efficiently handle interspersed newlines.
(base64_decode_alloc): Update signature.
* gl/lib/base64.h (struct base64_decode_context): Define.
(base64_decode_ctx_init): Add prototype.
(base64_decode, base64_decode_alloc): Update prototypes.
[doc/ChangeLog]
* coreutils.texi (base64 invocation): When decoding, newlines
are always accepted.
ChangeLog
doc/ChangeLog
doc/coreutils.texi
gl/lib/base64.c
gl/lib/base64.h
src/base64.c
tests/misc/base64