From 3b933f1e33197fec6a59466df1337292ec7bfa56 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 4 Jan 2007 11:52:52 +0100 Subject: [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 . (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. --- doc/coreutils.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/coreutils.texi') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index ae072d74d..6fc670479 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -1849,7 +1849,8 @@ output will be the original data. @opindex -i @opindex --ignore-garbage @cindex Ignore garbage in base64 stream -During decoding, ignore unrecognized characters (including newline), +When decoding, newlines are always accepted. +During decoding, ignore unrecognized bytes, to permit distorted data to be decoded. @end table -- cgit v1.2.3-70-g09d2