Age | Commit message (Collapse) | Author |
|
The new function directly references debugfile, so needs the ifdef.
The old function compiles fine, but since it's not used, put it inside
the ifdef too.
Thanks to Ian Allen for reporting the problem.
|
|
dprintf(n, fmt, ...) is a more natural form of
dprint(n, (debugfile, fmt, ...)). It prints code location in the debug
file where possible.
I believe this approach, while common, was not previously used because
we were trying to be C90-compatible. C90 doesn't provide variadic
macros. Now we require C99, so it makes sense to add this pattern.
|
|
All callers now call the buffer function instead.
|
|
The Outlook content-type fix in commit 4cec4b63 inadvertantly
introduced a use-after-free. Calling mutt_set_parameter() pointing to
a different part of the same string ends up calling mutt_str_replace()
with both parameters pointing to the same hunk of memory.
Improve mutt_str_replace() to deal with that case, to fix this bug and
prevent possible future bugs resulting from that mistake.
Thank you to Vita Batrla for the excellent bug report and patch. I
merely added a comment and removed the "SAFE_FREE comment" from his
patch.
|
|
Add helper functions mutt_buffer_substrcpy() and
mutt_buffer_concatn_path().
Remove mutt_concatn_path() because mutt_complete() was the only
caller.
|
|
Add mutt_mkdir() library function supporting recursive mkdir.
|
|
Relocate safe_symlink(), safe_open(), mutt_rmtree() and their
dependent functions.
This rearrangement is a bit awkward. Another approach for the future
might be to convert lib.c into a muttlib.c aware file, and just copy
the functions pgppubring.c uses inside itself.
|
|
So it can be converted to use BUFFER.
|
|
Add spaces after if, else, while, for, switch.
Unify the brace placement style. The vast majority of the code uses
Allman style so convert the relatively few K&R braces over.
|
|
These are mostly automated changes corresponding to the emacs
settings:
(c-set-style "linux")
(setq c-basic-offset 2)
(c-set-offset 'case-label '+)
Most of the code follows the convention:
(add-to-list 'c-cleanup-list 'space-before-funcall)
but this is not enforced by this indentation cleanup.
Also, I personally dislike tabs, so I have:
(setq-default indent-tabs-mode nil)
in my own configuration. However I have no desire to change every line
just for that effect. So this cleanup does nothing about the mix issue.
Some of the secondary files (e.g. regex.c) have been skipped.
I've also skipped crypt-gpgme.c, because I need to think about that
file. Werner Koch and the GnuPG team contributed most it, and it
follows the Gnu indentation settings. It should probably be made
uniform with Mutt, but I don't want to discourage future GnuPG
contribution to the file.
I manually reverted a few unsightly cleanups, and added a few tweeks
when I saw things that could be improved.
|
|
The result of
find . -name "*.[ch]" -exec emacs -batch {} \
--eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
|
|
I originally kept the lstat()'s in order to make as few changes as
possible to the function. However, Derek Martin argues correctly that
if we are trusting the link() 0-retval, the lstats are unnecessary and
in fact can cause a performance impact over NFS.
|
|
It is apparently possible for link() to return an error but the link
to still be created. Add a double check for that case. If the files
match, unlink the src and return success.
|
|
Some filesystems, such as sshfs, implement hard links strangely. The
hard link is created, but is represented by a different inode number
by the sshfs layer. The current maildir code goes into an infinite
loop in this case. Remove the compare_stat() and trust that a link()
return code of 0 means the link really did get created. Still, keep
the stats just as a minor check.
|
|
Store MODSEQ in the header cache, and use that to perform a "FETCH
CHANGEDSINCE" for header updates when initially downloading messages.
Further improvements could be made to add support when syncing.
Handling MODSEQ for FLAG updates while the mailbox is open would be
complicated by the fact that Mutt supports locally modified headers,
so we couldn't accept the new (or subsequent) MODSEQ.
However, this initial step may at least provide some benefit when
opening the mailbox, which is generally the most time and data
intensive.
|
|
* Detect overflow on negative numbers too (< LONG_MIN).
* Distinguish between format error and number overflow as already
expected (e.g. for pgp_timeout and smime_timeout).
|
|
Otherwise providing LONG_MAX+1 then LONG_MAX gave an error for LONG_MAX too.
|
|
Several places in the imap code, when parsing "number" and "nz-number"
values from the IMAP data, use atoi() and strtol(). This is
incorrect, and can result in failures when a uid value happens to be
larger than 2^31.
Create a helper function, mutt_atoui() and use that instead. One
place was using strtol() and relying on the endptr parameter, and so
was changed to use strtoul() instead.
Thanks to Paul Saunders for the bug report and original patch, which
this commit is based on.
|
|
Changeset 23334e967dd7 created a workaround for a namespace conflict
with Solaris and derivatives. After some discussion, the team decided
it would be best to move away from using the "M_" prefix for macros.
This patch was automatically generated by running:
perl -wpi -e 's/\bM_(\w+)\b/MUTT_$1/g' `find . -name '*.[ch]' -print`
with the exception that sys_socket.h was exempted. (That file will
be backed out subsequent to this commit.)
Thanks to Andras Salamon for supplying the perl script used to make
this change.
|
|
Vincent Lefèvre pointed out the common shortcut, e.g 1996-9, is
actually not allowed for copyright years. Convert all the copyright
years (for mutt files) to use 4 digits.
|
|
This patch only updates existing copyright notices in the source
files, using commit dates since the last copyright update in commits
e3af935cdb1a and f8fd60d8d3f2.
Add a notice to the COPYRIGHT file to refer to our mercurial
repository for the full commit history.
Add myself to the COPYRIGHT file and smime_keys.pl file.
|
|
|
|
|
|
mkdir()
closes #3637
|
|
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%.
|
|
performs a similar task
|
|
|
|
|
|
|
|
|
|
|
|
We use these to stop supporting EOL-escaping with \ which was
wrong in most cases (e.g. $history_file), support is kept for
reading config and mailcap files.
Leaving CRLF in will be used for the pager.
|
|
|
|
I went through the logs of each file with a copyright header and
updated the years for the authors in the headers for any non-comment
changes they introduced. What a pain!
|
|
|
|
|
|
This was pretty convoluted because GPGME provides no way to examine a
key block without importing it. This code creates a temporary GPG home
in which to import the key in order to display it.
|
|
|
|
|
|
|
|
|
|
Avoid altering the argument to mutt_complete() when completion fails. Previously, the trailing component of filename was removed each time the user pressed TAB.
|
|
sshfs returns ENOSYS when attempting cross-directory links.
vfat returns EPERM.
|
|
Per #2707, when an open file is moved into a different directory over
NFS, it may leave a .nfsXXX hardlink behind. This causes the rmdir in
safe_open to fail, leaving tempdir droppings around. This patch works
around the problem by closing the file after creating it and reopening
it after rename.
|
|
|
|
init.c could really use some refactoring.
|
|
to safe_rename().
|
|
|
|
Add checks to check_sec.sh for memory functions.
These include a check for use of safe_free() instead of FREE() and a
check whether FREE(&...) is used.
For the former, __SAFE_FREE_CHECKED__ is to be used, for the latter
__FREE_CHECKED__ to avoid messages from check_sec.sh
|
|
|