Michael Elkins [Sun, 30 Dec 2012 17:26:30 +0000 (09:26 -0800)]
remove m4_translit because it generates a warning with newer versions of autoconf when used in AC_INIT. Instead, use tr -d to output the version string without a trailing newline.
Aaron Schrab [Fri, 28 Dec 2012 04:33:25 +0000 (20:33 -0800)]
Use the directory where the version.sh script is located as the
directory where it is run. Since this will be run in a separate shell
anyway, there's no need to worry about changing current directory.
This eliminates the need for the caller to specify where the source
directory is located, and doesn't require that the code take special
care to use the appropriate directory. The fallback method of using
`cat VERSION` was broken in this respect, it would not work when run
from a different directory.
---
configure.ac | 2 +-
version.sh | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
Michael Elkins [Sat, 22 Dec 2012 23:04:24 +0000 (15:04 -0800)]
If neither --with-idn nor --without-idn are given, use -I/usr/include/idn when checking for the libidn header files, if present (needed for Solaris 11).
Don't bother checking for the idna_* functions if we didn't find -lidn
Michael Elkins [Tue, 18 Dec 2012 10:21:57 +0000 (02:21 -0800)]
fix problem where mutt_substrdup() was called with the start
pointer > end pointer, as a result of using SKIPWS(). This
occurred because the header field had an empty body, so the
trailing newline was skipped over. The fix is to just skip over
ascii space and htab.
hhorak [Tue, 18 Dec 2012 01:09:18 +0000 (17:09 -0800)]
fix segfault in pop driver. when rereading the message header, the ENVELOPE* struct is freed, but ctx->subj_hash retains a pointer to env->real_subj, so the hash table entry must be deleted prior to calling mutt_free_envelope()
David Champion [Tue, 16 Oct 2012 23:13:13 +0000 (18:13 -0500)]
Add compiler and configure info to mutt -v output (closes #3537)
Makefile(.am) updated to produce conststrings.c, which contains
C strings representing:
* the compiler's own version information;
* the CFLAGS value from the Make environment
* the ./configure options
main.c is updated to print them when running 'mutt -v'.
txt2c.sh is added to produce conststrings.c. txt2c.sh uses a compiled
txt2c binary if possible, for complete fidelity to the source strings
in whatever encoding they may use. If txt2c is not available (could
not be compiled, or was not compiled natively) it falls back on a shell
function to approximate the output using sed and tr.
Currently, no callers were providing a non-NULL buffer to
mutt_buffer_init, and splitting it will allow more sane semantics for
buffer allocation, initialization, and destruction in a later patch.
It will cause mutt_buffer_* to segfault if it needs to grow the space.
Thanks to Steve Losh for discovering the issue. I have done some simple
grepping to find other cases, but some may remain.
gnutls:tls_compare_certificates: check strstr for failure (closes #3547)
A malformed certificate file could cause strstr to return an unhandled NULL.
Thanks to hhorak for the proposed patch. This one is similar but avoids using
memmem for the first time (I am not sure about its portability).
Dan Fandrich [Sat, 3 Dec 2011 19:13:10 +0000 (11:13 -0800)]
Declare many structures const (closes #3552)
Many structs used in mutt are actually constant but are defined
without the 'const' keyword. This can slow initialization (slightly)
in some environments due to extra copying and increases the amount of
writable RAM required at run-time, which can be significant on non-MMU
systems. Using const can also increase the opportunities for compiler
optimization.
The attached patch marks many such structures as const. On my test x86
build, this reduces the size of .data by over 50%.
David Champion [Wed, 13 Jul 2011 16:05:37 +0000 (11:05 -0500)]
Invalidate header caches when spam rules change. closes #3473
User 'exg' on #mutt reported a problem when using header cache with IMAP
and spam rules. Spam tags are retrieved from cache and not updated when
spam rules change.
1. Enable header caching in muttrc
2. Set spam rules in muttrc
3. Use IMAP (or POP or Maildir). Your spam rules store spam tags into
your message headers, and these get cached.
4. Quit mutt
5. Change your spam rules in muttrc
6. Relaunch mutt
7. Because of header caching, the rfc822 headers are not reparsed, and
spam rules are not reapplied. User has outdated spam tags.
Spam rules are applied during rfc822 header parsing because it's the
only time we get a full and unadulterated view of all headers. Once
header parse is done we have only processed headers and 'user headers'
(X-headers). We might do spam rule matching against the struct HEADER
copy of headers, except that:
a. the header might not be in HEADER if it's non-standard and not an
X-header;
b. spam rules are regular expressions matching any arbitrary header
line, and we would need to map these regexps to the header used to
create the HEADER fields. This would change the syntax and behavior
of spam rules dramatically.
One solution, perhaps stopgap, is to invalidate the header cache when
spam rules change. That's what this patch does. It alters the hcache
versioning algorithm so that in addition to using the compiled-in
checksum of mutt's structures definitions, we also mix in the user's
runtime spam rules. Any time spam rules change the hcachever hash value
changes, causing the hcache to be rewritten.
version.sh: fix(?) failure due to bizarre sh quoting rules
I have not checked POSIX, and sh quoting always makes my head hurt, but this
seems to suffice for my sh (actually bash in sh mode) when HGROOT contains a space.
Olaf Hering [Mon, 23 May 2011 10:59:14 +0000 (12:59 +0200)]
fix gcc 4.6 warning -Wunused-but-set-variable in pgppubring.c
pgppubring.c: In function 'pgp_parse_pgp3_sig':
pgppubring.c:424:17: warning: variable 'hashalg' set but not used [-Wunused-but-set-variable]
pgppubring.c:423:17: warning: variable 'pkalg' set but not used [-Wunused-but-set-variable]