diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-12-09 10:01:06 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-12-09 10:01:06 +0200 |
commit | 8f8d9036cc943e4884b21ad050a1d443e102e47e (patch) | |
tree | a4f4979174df5ee1dd1339147fd68cbffa2ea00d /libmailutils | |
parent | aa1caef5a181287fcd68a4ec9a600e4927a40833 (diff) | |
download | mailutils-8f8d9036cc943e4884b21ad050a1d443e102e47e.tar.gz mailutils-8f8d9036cc943e4884b21ad050a1d443e102e47e.tar.bz2 |
Implement filter chains. Revamp filter output length support.
* include/mailutils/filter.h (mu_filter_chain_create_pred)
(mu_filter_chain_create): New prototypes.
(_mu_filter_record)<max_line_length>: Remove.
* libmailutils/filter/fltchain.c: New file.
* libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add fltchain.c.
* libmailutils/filter/base64.c: Implement line length limit for encoder.
(base64_state): New enum.
(base64_line): New struct.
(_base64_encoder): xd brings a pointer to struct base64_line. Use it
to limit the output line length.
(alloc_state): New function.
(_base64_filter): Register alloc_state.
(_base64_filter, _B_filter): Remove max_line_length initialization.
* libmailutils/filter/binflt.c: Remove max_line_length initialization.
* libmailutils/filter/crlfflt.c: Likewise.
* libmailutils/filter/dot.c: Likewise.
* libmailutils/filter/fromflt.c: Likewise.
* libmailutils/filter/header.c: Likewise.
* libmailutils/filter/inline-comment.c: Likewise.
* libmailutils/filter/linecon.c: Likewise.
* libmailutils/filter/qpflt.c: Likewise.
* libmailutils/filter/linelenflt.c: Redo line filter as a regular filter.
(mu_linelen_filter): New global.
* libmailutils/filter/filter.c (mu_filter_get_list): Register mu_linelen_filter.
(filter_create_rd, filter_create_wr): Remove.
(mu_filter_create_args): Use mu_filter_stream_create directly.
* examples/base64.c: Re-implement the -l option via filter chains.
* libmailutils/tests/fltst.c: Remove the linelen option.
* libmailutils/tests/base64d.at: Remove the linelen option from fltst
invocations.
* mu/filter.c: Remove the --line-length option. Not needed now, its
effect is achieved by "FLT + [~]linelen" chain.
Diffstat (limited to 'libmailutils')
-rw-r--r-- | libmailutils/filter/Makefile.am | 1 | ||||
-rw-r--r-- | libmailutils/filter/base64.c | 102 | ||||
-rw-r--r-- | libmailutils/filter/binflt.c | 3 | ||||
-rw-r--r-- | libmailutils/filter/crlfdot.c | 1 | ||||
-rw-r--r-- | libmailutils/filter/crlfflt.c | 2 | ||||
-rw-r--r-- | libmailutils/filter/dot.c | 1 | ||||
-rw-r--r-- | libmailutils/filter/filter.c | 85 | ||||
-rw-r--r-- | libmailutils/filter/fltchain.c | 187 | ||||
-rw-r--r-- | libmailutils/filter/fromflt.c | 1 | ||||
-rw-r--r-- | libmailutils/filter/header.c | 1 | ||||
-rw-r--r-- | libmailutils/filter/inline-comment.c | 1 | ||||
-rw-r--r-- | libmailutils/filter/linecon.c | 1 | ||||
-rw-r--r-- | libmailutils/filter/linelenflt.c | 31 | ||||
-rw-r--r-- | libmailutils/filter/qpflt.c | 2 | ||||
-rw-r--r-- | libmailutils/tests/base64d.at | 4 | ||||
-rw-r--r-- | libmailutils/tests/fltst.c | 29 |
16 files changed, 318 insertions, 134 deletions
diff --git a/libmailutils/filter/Makefile.am b/libmailutils/filter/Makefile.am index 38d9101f2..2d5659b89 100644 --- a/libmailutils/filter/Makefile.am +++ b/libmailutils/filter/Makefile.am @@ -26,6 +26,7 @@ libfilter_la_SOURCES =\ dot.c\ filter.c\ filter_iconv.c\ + fltchain.c\ fromflt.c\ header.c\ inline-comment.c\ diff --git a/libmailutils/filter/base64.c b/libmailutils/filter/base64.c index 2b65cada3..02085765f 100644 --- a/libmailutils/filter/base64.c +++ b/libmailutils/filter/base64.c @@ -175,25 +175,54 @@ _base64_decoder (void *xd MU_ARG_UNUSED, return mu_filter_ok; } +enum base64_state +{ + base64_init, + base64_newline, + base64_rollback +}; + +struct base64_line +{ + enum base64_state state; + size_t max_len; + size_t cur_len; + char save[3]; + int idx; +}; + static enum mu_filter_result -_base64_encoder (void *xd MU_ARG_UNUSED, +_base64_encoder (void *xd, enum mu_filter_command cmd, struct mu_filter_io *iobuf) { + struct base64_line bline, *lp = xd; size_t consumed = 0; int pad = 0; - const unsigned char *ptr = (const unsigned char*) iobuf->input; + const unsigned char *ptr; size_t nbytes = 0; size_t isize; char *optr; size_t osize; enum mu_filter_result res; - + + if (!lp) + { + lp = &bline; + lp->max_len = 0; + lp->state = base64_init; + } switch (cmd) { case mu_filter_init: + lp->state = base64_init; + lp->cur_len = 0; + lp->idx = 3; + return mu_filter_ok; + case mu_filter_done: return mu_filter_ok; + default: break; } @@ -214,15 +243,48 @@ _base64_encoder (void *xd MU_ARG_UNUSED, return mu_filter_moreoutput; } + ptr = (const unsigned char*) iobuf->input; isize = iobuf->isize; optr = iobuf->output; osize = iobuf->osize; - while ((consumed + 3 <= isize && nbytes + 4 <= osize) || pad) + while (nbytes < osize) { unsigned char c1 = 0, c2 = 0, x = '=', y = '='; + + if (lp->max_len && lp->cur_len == lp->max_len) + { + if (lp->state == base64_init) + lp->idx = 3; + lp->state = base64_newline; + } + switch (lp->state) + { + case base64_init: + break; + case base64_newline: + *optr++ = '\n'; + nbytes++; + lp->cur_len = 0; + lp->state = base64_rollback; + /* Fall through */ + case base64_rollback: + if (lp->idx < 3) + { + *optr++ = lp->save[lp->idx++]; + nbytes++; + lp->cur_len++; + continue; + } + lp->state = base64_init; + } + + if (!(consumed + 3 <= isize || pad)) + break; *optr++ = b64tab[ptr[0] >> 2]; + nbytes++; + lp->cur_len++; consumed++; switch (isize - consumed) { @@ -235,20 +297,22 @@ _base64_encoder (void *xd MU_ARG_UNUSED, x = b64tab[((ptr[1] << 2) + c2) & 0x3f]; c1 = (ptr[1] >> 4); case 0: - *optr++ = b64tab[((ptr[0] << 4) + c1) & 0x3f]; - *optr++ = x; - *optr++ = y; + lp->save[0] = b64tab[((ptr[0] << 4) + c1) & 0x3f]; + lp->save[1] = x; + lp->save[2] = y; + lp->idx = 0; + lp->state = base64_rollback; } ptr += 3; - nbytes += 4; pad = 0; } /* Consumed may grow bigger than isize if cmd is mu_filter_lastbuf */ if (consumed > iobuf->isize) consumed = iobuf->isize; - if (cmd == mu_filter_lastbuf && consumed < iobuf->isize) + if (cmd == mu_filter_lastbuf && + (consumed < iobuf->isize || lp->state == base64_rollback)) res = mu_filter_again; else res = mu_filter_ok; @@ -257,10 +321,25 @@ _base64_encoder (void *xd MU_ARG_UNUSED, return res; } +static int +alloc_state (void **pret, int mode, int argc, const char **argv) +{ + if (mode == MU_FILTER_ENCODE) + { + struct base64_line *lp = malloc (sizeof (*lp)); + if (!lp) + return ENOMEM; + lp->max_len = 76; + *pret = lp; + } + else + *pret = NULL; + return 0; +} + static struct _mu_filter_record _base64_filter = { "base64", - 76, - NULL, + alloc_state, _base64_encoder, _base64_decoder }; @@ -269,7 +348,6 @@ mu_filter_record_t mu_base64_filter = &_base64_filter; static struct _mu_filter_record _B_filter = { "B", - 0, NULL, _base64_encoder, _base64_decoder diff --git a/libmailutils/filter/binflt.c b/libmailutils/filter/binflt.c index 1faf88c7c..c0df9be8e 100644 --- a/libmailutils/filter/binflt.c +++ b/libmailutils/filter/binflt.c @@ -83,7 +83,6 @@ _bit7_coder (void *xd MU_ARG_UNUSED, static struct _mu_filter_record _binary_filter = { "binary", - 0, NULL, _copy_codec, _copy_codec @@ -94,7 +93,6 @@ mu_filter_record_t mu_binary_filter = &_binary_filter; static struct _mu_filter_record _bit8_filter = { "8bit", - 0, NULL, _copy_codec, _copy_codec @@ -104,7 +102,6 @@ mu_filter_record_t mu_bit8_filter = &_bit8_filter; static struct _mu_filter_record _bit7_filter = { "7bit", - 0, NULL, _bit7_coder, _copy_codec diff --git a/libmailutils/filter/crlfdot.c b/libmailutils/filter/crlfdot.c index a0295c733..f6af819d2 100644 --- a/libmailutils/filter/crlfdot.c +++ b/libmailutils/filter/crlfdot.c @@ -327,7 +327,6 @@ alloc_state (void **pret, int mode MU_ARG_UNUSED, static struct _mu_filter_record _crlfdot_filter = { "CRLFDOT", - 0, alloc_state, _crlfdot_encoder, _crlfdot_decoder diff --git a/libmailutils/filter/crlfflt.c b/libmailutils/filter/crlfflt.c index ea5b8ce67..a527f38ca 100644 --- a/libmailutils/filter/crlfflt.c +++ b/libmailutils/filter/crlfflt.c @@ -160,7 +160,6 @@ alloc_state (void **pret, int mode, static struct _mu_filter_record _crlf_filter = { "CRLF", - 0, alloc_state, _crlf_encoder, _crlf_decoder @@ -172,7 +171,6 @@ mu_filter_record_t mu_crlf_filter = &_crlf_filter; /* For compatibility with previous versions */ static struct _mu_filter_record _rfc822_filter = { "RFC822", - 0, alloc_state, _crlf_encoder, _crlf_decoder diff --git a/libmailutils/filter/dot.c b/libmailutils/filter/dot.c index b96216103..072576ea9 100644 --- a/libmailutils/filter/dot.c +++ b/libmailutils/filter/dot.c @@ -259,7 +259,6 @@ alloc_state (void **pret, int mode MU_ARG_UNUSED, static struct _mu_filter_record _dot_filter = { "DOT", - 0, alloc_state, _dot_encoder, _dot_decoder diff --git a/libmailutils/filter/filter.c b/libmailutils/filter/filter.c index 1ebd4e9fe..7a375fe5f 100644 --- a/libmailutils/filter/filter.c +++ b/libmailutils/filter/filter.c @@ -81,6 +81,7 @@ mu_filter_get_list (mu_list_t *plist) mu_list_append (filter_list, mu_inline_comment_filter); mu_list_append (filter_list, mu_header_filter); mu_list_append (filter_list, mu_linecon_filter); + mu_list_append (filter_list, mu_linelen_filter); /* FIXME: add the default encodings? */ } *plist = filter_list; @@ -88,77 +89,6 @@ mu_filter_get_list (mu_list_t *plist) return 0; } -static int -filter_create_rd (mu_stream_t *pstream, mu_stream_t stream, - size_t max_line_length, - int mode, - mu_filter_xcode_t xcode, void *xdata, - int flags) -{ - int status; - mu_stream_t fltstream; - - flags &= ~MU_STREAM_AUTOCLOSE; - - status = mu_filter_stream_create (&fltstream, stream, - mode, xcode, xdata, - flags); - if (status == 0) - { - if (max_line_length) - { - status = mu_linelen_filter_create (pstream, fltstream, - max_line_length, - flags); - mu_stream_unref (fltstream); - if (status) - return status; - } - else - *pstream = fltstream; - - if (flags & MU_STREAM_AUTOCLOSE) - mu_stream_unref (stream); - } - return status; -} - -static int -filter_create_wr (mu_stream_t *pstream, mu_stream_t stream, - size_t max_line_length, - int mode, - mu_filter_xcode_t xcode, void *xdata, - int flags) -{ - int status; - mu_stream_t fltstream, instream = NULL, tmpstr; - - flags &= ~MU_STREAM_AUTOCLOSE; - - if (max_line_length) - { - status = mu_linelen_filter_create (&instream, stream, - max_line_length, - flags); - if (status) - return status; - tmpstr = instream; - } - else - tmpstr = stream; - - status = mu_filter_stream_create (&fltstream, tmpstr, - mode, xcode, xdata, - flags); - mu_stream_unref (instream); - if (status) - return status; - *pstream = fltstream; - if (flags & MU_STREAM_AUTOCLOSE) - mu_stream_unref (stream); - return status; -} - int mu_filter_create_args (mu_stream_t *pstream, mu_stream_t stream, const char *name, int argc, const char **argv, @@ -189,15 +119,12 @@ mu_filter_create_args (mu_stream_t *pstream, mu_stream_t stream, return status; } - status = ((flags & MU_STREAM_WRITE) ? filter_create_wr : filter_create_rd) - (pstream, stream, - mode == MU_FILTER_ENCODE ? frec->max_line_length : 0, - mode, - xcode, - xdata, - flags); + status = mu_filter_stream_create (pstream, stream, + mode, xcode, xdata, + flags); if (status) - free (xdata); + free (xdata); + return status; } diff --git a/libmailutils/filter/fltchain.c b/libmailutils/filter/fltchain.c new file mode 100644 index 000000000..b2c2120d0 --- /dev/null +++ b/libmailutils/filter/fltchain.c @@ -0,0 +1,187 @@ +/* GNU Mailutils -- a suite of utilities for electronic mail + Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009, 2010 Free + Software Foundation, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <errno.h> +#include <string.h> +#include <stdlib.h> + +#include <mailutils/filter.h> +#include <mailutils/stream.h> +#include <mailutils/errno.h> + +static int +negate_filter_mode (int mode) +{ + if (mode == MU_FILTER_DECODE) + return MU_FILTER_ENCODE; + else if (mode == MU_FILTER_ENCODE) + return MU_FILTER_DECODE; + abort (); +} + +static int +_add_next_link (mu_stream_t *pret, mu_stream_t transport, + int defmode, int flags, + size_t argc, char **argv, + int (*pred) (void *, mu_stream_t, const char *), + void *closure) +{ + int mode; + int qmark = 0; + char *fltname; + int status = 0; + + fltname = argv[0]; + if (fltname[0] == '?') + { + if (pred) + qmark = 1; + fltname++; + } + + if (fltname[0] == '~') + { + mode = negate_filter_mode (defmode); + fltname++; + } + else + mode = defmode; + + if (qmark == 0 || pred (closure, transport, fltname)) + { + status = mu_filter_create_args (pret, transport, fltname, + argc, (const char **)argv, + mode, flags); + mu_stream_unref (transport); + } + return status; +} + +int +_filter_chain_create (mu_stream_t *pret, mu_stream_t transport, + int defmode, + int flags, + size_t argc, char **argv, + int (*pred) (void *, mu_stream_t, const char *), + void *closure) +{ + while (argc) + { + size_t i; + int status; + mu_stream_t stream; + + for (i = 1; i < argc; i++) + if (strcmp (argv[i], "+") == 0) + break; + + status = _add_next_link (&stream, transport, + defmode, flags, + i, argv, + pred, closure); + if (status) + return status; + transport = stream; + + argc -= i; + argv += i; + if (argc) + { + argc--; + argv++; + } + } + *pret = transport; + return 0; +} + +int +_filter_chain_create_rev (mu_stream_t *pret, mu_stream_t transport, + int defmode, + int flags, + size_t argc, char **argv, + int (*pred) (void *, mu_stream_t, const char *), + void *closure) +{ + size_t pos; + + for (pos = argc; pos > 0;) + { + size_t i; + int status; + mu_stream_t stream; + + for (i = pos; i > 0; i--) + { + if (strcmp (argv[i - 1], "+") == 0) + break; + } + + status = _add_next_link (&stream, transport, + defmode, flags, + pos - i, argv + i, + pred, closure); + if (status) + return status; + transport = stream; + if (i > 0) + i--; + pos = i; + } + *pret = transport; + return 0; +} + +int +mu_filter_chain_create_pred (mu_stream_t *pret, mu_stream_t transport, + int defmode, + int flags, + size_t argc, char **argv, + int (*pred) (void *, mu_stream_t, const char *), + void *closure) +{ + int rc; + + mu_stream_ref (transport); + if (flags & MU_STREAM_WRITE) + rc = _filter_chain_create_rev (pret, transport, + defmode, flags, + argc, argv, + pred, closure); + else + rc = _filter_chain_create (pret, transport, + defmode, flags, + argc, argv, pred, closure); + if (rc) + mu_stream_unref (transport); + return rc; +} + +int +mu_filter_chain_create (mu_stream_t *pret, mu_stream_t transport, + int defmode, int flags, + size_t argc, char **argv) +{ + return mu_filter_chain_create_pred (pret, transport, defmode, flags, + argc, argv, NULL, NULL); +} + diff --git a/libmailutils/filter/fromflt.c b/libmailutils/filter/fromflt.c index 902fe3c8c..5822c233e 100644 --- a/libmailutils/filter/fromflt.c +++ b/libmailutils/filter/fromflt.c @@ -273,7 +273,6 @@ _from_alloc_state (void **pret, int mode, static struct _mu_filter_record _from_filter = { "FROM", - 0, _from_alloc_state, _from_encoder, _from_decoder diff --git a/libmailutils/filter/header.c b/libmailutils/filter/header.c index 8369d6aa4..01b4b0c99 100644 --- a/libmailutils/filter/header.c +++ b/libmailutils/filter/header.c @@ -112,7 +112,6 @@ alloc_state (void **pret, int mode MU_ARG_UNUSED, static struct _mu_filter_record _header_filter = { "HEADER", - 0, alloc_state, NULL, _hflt_decoder diff --git a/libmailutils/filter/inline-comment.c b/libmailutils/filter/inline-comment.c index 8def8b7cc..61ee11b7c 100644 --- a/libmailutils/filter/inline-comment.c +++ b/libmailutils/filter/inline-comment.c @@ -487,7 +487,6 @@ alloc_state (void **pret, int mode MU_ARG_UNUSED, int argc, const char **argv) static struct _mu_filter_record _inline_comment_filter = { "INLINE-COMMENT", - 0, alloc_state, _ilcmt_encoder, _ilcmt_decoder diff --git a/libmailutils/filter/linecon.c b/libmailutils/filter/linecon.c index f9ebffd21..c9ca6bcce 100644 --- a/libmailutils/filter/linecon.c +++ b/libmailutils/filter/linecon.c @@ -213,7 +213,6 @@ alloc_state (void **pret, int mode MU_ARG_UNUSED, int argc, const char **argv) static struct _mu_filter_record _linecon_filter = { "LINECON", - 0, alloc_state, NULL, _linecon_decoder, diff --git a/libmailutils/filter/linelenflt.c b/libmailutils/filter/linelenflt.c index e3817de9f..810491512 100644 --- a/libmailutils/filter/linelenflt.c +++ b/libmailutils/filter/linelenflt.c @@ -107,4 +107,35 @@ mu_linelen_filter_create (mu_stream_t *pstream, mu_stream_t stream, return mu_filter_stream_create (pstream, stream, MU_FILTER_ENCODE, _ll_encoder, flt, flags); } + +static int +alloc_state (void **pret, int mode MU_ARG_UNUSED, int argc, const char **argv) +{ + struct _mu_linelen_filter *flt = malloc (sizeof (flt[0])); + if (!flt) + return ENOMEM; + flt->cur_len = 0; + flt->max_len = 76; + if (argc > 1) + { + char *p; + flt->max_len = strtoul (argv[1], &p, 10); + if (*p) + { + free (flt); + return MU_ERR_PARSE; + } + } + *pret = flt; + return 0; +} + +static struct _mu_filter_record _linelen_filter = { + "LINELEN", + alloc_state, + _ll_encoder, + NULL, +}; + +mu_filter_record_t mu_linelen_filter = &_linelen_filter; diff --git a/libmailutils/filter/qpflt.c b/libmailutils/filter/qpflt.c index aaada1e5f..3f2279f12 100644 --- a/libmailutils/filter/qpflt.c +++ b/libmailutils/filter/qpflt.c @@ -243,7 +243,6 @@ _qp_encoder (void *xd MU_ARG_UNUSED, static struct _mu_filter_record _qp_filter = { "quoted-printable", - 0, NULL, _qp_encoder, _qp_decoder @@ -253,7 +252,6 @@ mu_filter_record_t mu_qp_filter = &_qp_filter; static struct _mu_filter_record _Q_filter = { "Q", - 0, NULL, _qp_encoder, _qp_decoder diff --git a/libmailutils/tests/base64d.at b/libmailutils/tests/base64d.at index 9983f58b7..55ee95510 100644 --- a/libmailutils/tests/base64d.at +++ b/libmailutils/tests/base64d.at @@ -19,7 +19,7 @@ AT_KEYWORDS([base64 base64d base64dr decode filter]) AT_CHECK([ cp $abs_top_srcdir/libmailutils/tests/Encode expout -fltst base64 decode read linelen=0 < $abs_top_srcdir/libmailutils/tests/Decode], +fltst base64 decode read < $abs_top_srcdir/libmailutils/tests/Decode], [0], [expout]) @@ -31,7 +31,7 @@ AT_KEYWORDS([base64 base64d base64dw decode filter]) AT_CHECK([ cp $abs_top_srcdir/libmailutils/tests/Encode expout -fltst base64 decode write linelen=0 < $abs_top_srcdir/libmailutils/tests/Decode], +fltst base64 decode write < $abs_top_srcdir/libmailutils/tests/Decode], [0], [expout]) diff --git a/libmailutils/tests/fltst.c b/libmailutils/tests/fltst.c index a92f1ecc7..db73e9d78 100644 --- a/libmailutils/tests/fltst.c +++ b/libmailutils/tests/fltst.c @@ -68,23 +68,6 @@ c_copy (mu_stream_t out, mu_stream_t in) } -/* Set the maximum line length for the filter NAME to LENGTH. - FIXME: This is a kludge. Perhaps API should provide a function - for that. */ -static void -reset_line_length (const char *name, size_t length) -{ - mu_list_t list; - int status; - mu_filter_record_t frec; - - mu_filter_get_list (&list); - status = mu_list_locate (list, (void*)name, (void**)&frec); - if (status == 0) - frec->max_line_length = length; - /* don't bail out, leave that to mu_filter_create */ -} - void usage (const char *diag) { @@ -99,7 +82,7 @@ usage (const char *diag) fp = stdout; fprintf (fp, "%s", - "usage: fltst FILTER {encode|decode} {read|write} [shift=N] [linelen=N] [verbose] [printable] [nl] [-- args]\n"); + "usage: fltst FILTER {encode|decode} {read|write} [shift=N] [verbose] [printable] [nl] [-- args]\n"); exit (diag ? 1 : 0); } @@ -112,8 +95,6 @@ main (int argc, char * argv []) int flags = MU_STREAM_READ; char *fltname; mu_off_t shift = 0; - size_t line_length; - int line_length_option = 0; int newline_option = 0; if (argc == 1) @@ -141,11 +122,6 @@ main (int argc, char * argv []) { if (strncmp (argv[i], "shift=", 6) == 0) shift = strtoul (argv[i] + 6, NULL, 0); - else if (strncmp (argv[i], "linelen=", 8) == 0) - { - line_length = strtoul (argv[i] + 8, NULL, 10); - line_length_option = 1; - } else if (strcmp (argv[i], "verbose") == 0) verbose++; else if (strcmp (argv[i], "printable") == 0) @@ -167,9 +143,6 @@ main (int argc, char * argv []) MU_ASSERT (mu_stdio_stream_create (&in, MU_STDIN_FD, 0)); MU_ASSERT (mu_stdio_stream_create (&out, MU_STDOUT_FD, 0)); - if (line_length_option) - reset_line_length (fltname, line_length); - if (flags == MU_STREAM_READ) { MU_ASSERT (mu_filter_create_args (&flt, in, fltname, |