David Levine [Fri, 18 Jan 2013 03:46:54 +0000 (21:46 -0600)]
Minimized message files reads in m_getfld() when the caller
interleaves calls to fseek(). Added check of handling of
long header field name without a colon to test-header.
David Levine [Thu, 17 Jan 2013 03:48:11 +0000 (21:48 -0600)]
Added check of header field body with more than 511
characters to test-inc-scanout. Also changed a couple of
test message files to be generated on the fly.
David Levine [Thu, 17 Jan 2013 02:13:04 +0000 (20:13 -0600)]
Cleaned up m_getfld() code a bit. The most notable change
was to remove the check for mmdlm2 not being null. It's
global data so that shouldn't happen.
David Levine [Wed, 16 Jan 2013 02:11:41 +0000 (20:11 -0600)]
Removed the for-loop that was used to get a header field
name in m_getfld (). It was no longer necessary when not
drawing directly from the stdio buffer.
David Levine [Tue, 15 Jan 2013 03:05:22 +0000 (21:05 -0600)]
In m_getfld(), fixed the loop that handles the FLDPLUS case.
In Getc(), removed the increment of the byte count at EOF,
it didn't seem correct or necessary.
David Levine [Tue, 15 Jan 2013 02:58:56 +0000 (20:58 -0600)]
m_getfld() now supports interleaving calls with
fseek()/ftell(). Reverted the changes to uip/mhparse.c of
commit 484eb1003ae647e4b751e4d7829c7daf44fb99c9 because
they're no longer necessary.
David Levine [Sat, 12 Jan 2013 16:58:31 +0000 (10:58 -0600)]
Cleaned up FLDPLUS handling in m_getfld(). As part of this,
removed the backing up of the read pointer in the "something
went wrong" portion of the FLD handling. It had been moved
back two positions. The first is no longer necessary
because a Getc() was replace by a Peek(), and the second
caused the extra blank line noted in the old comments.
Updated the expected output in test/bad-input/test-header to
correspond.
David Levine [Thu, 10 Jan 2013 02:50:58 +0000 (20:50 -0600)]
When read_more() loads more bytes, save some from the end of the
current chunk and move them to the front of the buffer. This
allows backing up of the current position, which is necessary when
looking for the message delimiter in a maildrop file.
David Levine [Sun, 6 Jan 2013 21:04:24 +0000 (15:04 -0600)]
Removed support for #ifdef LBL. It was broken anyways,
sometime between MH 6.8.5 and the Apr 1999 entry into CVS.
Also removed the addtoseq format function that could only be
accessed with it.
David Levine [Sun, 6 Jan 2013 15:38:21 +0000 (09:38 -0600)]
Fixed test-utf8-body to actually contain the UTF-8 character
instead of the single byte, 8-bit character. This was caught
using Heirloom shell with a UTF-8 locale: when it wrote the
test draft from a here document, it converted the single byte
character to UTF-8. This verifies that behavior:
David Levine [Fri, 4 Jan 2013 04:32:28 +0000 (22:32 -0600)]
Removed discard() call in post(8). It was only used with -debug
and seemed to serve no useful purpose any more. Its comment
said that it was needed to help the loader.
David Levine [Fri, 4 Jan 2013 03:59:44 +0000 (21:59 -0600)]
In cpstripped() and cptrimmed(), if a multibyte character is
found, only count it as taking up one character in the
destination buffer (if it has enought room). This way,
scan(1)'s output won't be jagged if there are any subjects,
for example, that have multibyte characters.
Added a test for this to test-scan-multibyte, and moved the
test for an invalid multibyte sequence from test-scan to it.
David Levine [Thu, 3 Jan 2013 02:07:43 +0000 (20:07 -0600)]
Fixed decoding of header fields when they contain a character that
can't be converted. Added test case to test-scan. valgrind also
noticed that things went amiss.
David Levine [Wed, 26 Dec 2012 15:52:12 +0000 (09:52 -0600)]
Restored an explicit refill of the buffer in m_getfld() that I
removed in the big stdio cleanup. Its need is shown by reducing
the message buffer size to 2048.
David Levine [Wed, 26 Dec 2012 01:25:43 +0000 (19:25 -0600)]
Removed call to fpurge() and its platform-specific emulations
from discard.c. discard() is called on stdout from mhl(1) and
msh(1) in interrupt handlers, and post(8) but only with -debug.
tcflush() should do the purge when stdout is a terminal. If
it's a file or pipe, well, maybe some garbage could get flushed
out. And it's called on the streams that post uses to talk to
its smtp server, so removed those calls because they no longer
do anything. And removed LINUX_STDIO define from configure.ac.
David Levine [Sat, 22 Dec 2012 17:51:21 +0000 (11:51 -0600)]
Changed bufsz argument of m_getfld() to be in-out instead of in.
This allowed removal of the msg_count global, in turn allowing
removal of sbr/m_msgdef.c
Paul Fox [Thu, 29 Nov 2012 18:59:55 +0000 (13:59 -0500)]
show: remove unreachable code
the stanza in question has been impossible to reach for some time. i
believe its purpose was to give a non-mh display proc full pathname
arguments to work with. since we've chdir'd to the folder, giving it
message numbers (i.e., relative pathnames) is fine.
Paul Fox [Tue, 27 Nov 2012 02:00:28 +0000 (21:00 -0500)]
Artificial argv limits.
when i skimmed the code earlier, i was looking at all the uses of
MAXARGS -- many of which are used to size local arrays. converting
them all to be dynamically-sized might be a fair amount of work.
but looking at rmm.c, refile.c, and folder_delmsgs(), i don't think
that issue applies. the patch below fixes the problem, and makes
rmmproc and refile do the right thing (well, at least, the modern
thing). NB: i didn't test to the limit where execvp should return
E2BIG.
as for the rest of mh -- it's certainly possible to hit the MAXARGS
limit with other commands (show, for instance), but i suspect the
frequency is much lower, and those, too, can be fixed as needed.
paul
>From 9636bc0e1697829966f51d2c301cd5d730c38c0a Mon Sep 17 00:00:00 2001
From: Paul Fox <pgf@foxharp.boston.ma.us>
Date: Mon, 26 Nov 2012 20:49:55 -0500
Subject: [PATCH] rmm/refile: remove the MAXARGS limit when running rmmproc