summaryrefslogtreecommitdiffstats
path: root/lib.h
AgeCommit message (Collapse)Author
2019-01-04Clean up formatting.Kevin McCarthy
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.
2018-12-31Remove trailing whitespace.Kevin McCarthy
The result of find . -name "*.[ch]" -exec emacs -batch {} \ --eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
2018-09-30Increase buffer sizes for some IMAP commands.Kevin McCarthy
Use to ensure assembled IMAP commands fit in the resultant buffer to be imap_exec()'ed. RFC2683 suggested a limit of 1000, but asked servers to accept up to 8000. Furthermore, RFC7162 bumped the client limit suggestion up to 8192. So I don't believe any issues will be caused by this. Most of these are increases are just to remove theoretical truncation warned about by the compiler; I don't believe we've had reports of actual command truncation due to a mailbox 1024 characters long.
2018-08-11Add basic CONDSTORE support when fetching initial messages.Kevin McCarthy
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.
2018-01-06Fix improper signed int conversion of IMAP uid and msn values.Kevin McCarthy
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.
2016-11-29Add mutt_array_size macro, change interactive_check_cert() to use it. (see ↵Kevin McCarthy
#3899) While I have reservations about the construct, it does make the interactive_check_cert() menu->max and part loop less fragile.
2016-05-09Change M_* symbols to MUTT_*Derek Martin
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.
2016-01-23Increase HUGE_STRING size to 8192. (see #3804)Kevin McCarthy
The interface for editing a large number of recipients is poor and perhaps shouldn't be using a fixed buffer size. Until a redesign can be thought about, this will help.
2016-01-01Update copyright notices.Kevin McCarthy
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.
2015-11-09Fix possible unintentional '\0' strchr matches.Kevin McCarthy
After fixing the ticket 3787 strchr issue, this patch cleans up other potentially incorrect uses of strchr for the '\0' case. In mutt_multi_choice(), mutt_getch() can technically return 0. Although it seems the user would have to try quite hard to do this, it's incorrect to return that index into letters. Change "ch.ch==0" to be considered the same as an abort. is_email_wsp() is used in a couple places where it wasn't obvious whether '\0' was being accounted for, so add an explicit check to the function. Inside eat_date(), if mutt_extract_token() had no input and returned "", the strchr ("<>=", buffer.data[0]) below would return a pointer. In actuality, this is prevented by an empty parameter check inside mutt_pattern_comp(), but it doesn't hurt to make it the same as eat_regexp() and have the check explicitly done here too. rfc2047_encode() was another borderline case for adding a check. The convert_string() sets a length, so it seems highly unlikely that *t could be 0, but doesn't hurt to add the check. The find_encoded_word() fix looks necessary. If the passed in s was something like "=?charset?" (followed by EOS, '\0'), the strchr("BbQq", q[1]) would in fact return a pointer and the following q[2] would read past the end of string. If q[2] happened to be '?', it might even continue reading in the for loop below. Lastly, in parse_mailboxdomain(), the potential overread was already fixed in changeset:a6919571eb59, but although the nonspecial and special strchr() line happens to "work" for the case of '\0', it's pretty fragile to leave as is. It's better to be explicit and just return if we hit EOS without calling next_token().
2012-12-18rename iswsp() to is_email_wsp()Michael Elkins
add new inline funtion skip_email_wsp() to be used in lieu of SKIPWS() when parsing ASCII protocols rather than user input. change use of SKIPWS() to skip_email_wsp() in places where it is likely to be a problem.
2010-08-09rename mutt_sprintf() to safe_asprintf() to match the GNU extension that ↵Michael Elkins
performs a similar task
2010-08-08add a malloc+sprintf combo functionMichael Elkins
2010-08-06Resolve if/else empty body ambiguity/warnings when compiling without DEBUG.Matthias Andree
2009-06-15Print timestamps in debug files. Closes #3263.Rocco Rutte
2009-06-01Add mutt_atos(), mutt_atoi() and mutt_atol() (strtol() wrappers)Rocco Rutte
2009-05-29Add flags to mutt_read_line() for EOL-stripping and continuation supportRocco Rutte
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.
2009-01-04Update copyrights. Closes #3016.Brendan Cully
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!
2008-07-01Support displaying application/pgp-keys with GPGME.Brendan Cully
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.
2008-06-26fflush before fsync and close. Closes #2962 again.Brendan Cully
2007-11-20Alternate fix for not calling bind_textdomain_codeset() to fix Solaris build.Rocco Rutte
2007-11-15Don't use bind_textdomain_codeset() if we're not using NLS/gettext. Closes ↵peb
#2162.
2007-08-28Use limits.h for PATH_MAX instead of posix1_lim.h (closes #2525)Brendan Cully
2007-07-08This patch implements the "%* " notation, which is analogous to "%> "David Champion
but gives precedence to the right side instead of to the left when the fill length is zero. The default $pager_format is updated to use it so that %P is always available at the edge of the screen.
2007-04-07bug #2871Michael Elkins
Avoid altering the argument to mutt_complete() when completion fails. Previously, the trailing component of filename was removed each time the user pressed TAB.
2007-01-02add debug harness to lib.c functions, and a bunch of dprint'sThomas Roessler
to safe_rename().
2005-09-17Gah, forgot the zip code when updating the FSF address...Brendan Cully
2005-09-17Update FSF address (via sed, I hope nothing got mangled). Closes: #2071.Brendan Cully
2005-08-06Report non-zero exit status of tunnel command. Closes: #1749.Brendan Cully
2005-02-05Remove a number of unnecessary config.h includes, and add someThomas Roessler
missing ones. May fix some bugs.
2004-10-30safe_strcat, safe_strncat. Thanks to Ulf H. for noting the wrongThomas Roessler
use of strncat in part of the mutt code base.
2003-10-04This patch fixes various aspects of the attachment-savingThomas Roessler
user interface. Changes include: * When tagging and saving multiple attachments, you can now use the same target directory for multiple attachments. * When you can't save an attachment, you get an opportunity to enter a new file name. * The menu cursor will highlight the attachment that you are currently discussing with mutt. * Various bug fixes. This does, in particular, address #1619 (Debian#208430).
2003-09-19As the ones of you who compile with new gcc's probably have noticed,Mads Martin Joergensen
there's a lot of type-punning in Mutt. With help from Philipp Thomas, I've fixed all I could find in CVS (please double-check, one might have slipped through the cracks), I can make one for 1.4 CVS branch as well if wanted.
2002-12-11Herbert Martin Dietze <herbert@the-little-red-haired-girl.org> notesThomas Roessler
that mutt may currently build IMAP URLs like imap://exchange//herbert for FCCs. The fix in this patch is to include a function named mutt_concat_path which concatenates path elements, but avoids the creation of double slashes. (These don't create problems when you're just accessing the file system, but apparently thy do cause problems with IMAP.)
2002-12-11Fix Mike's and my e-mail addresses in copyright lines.Thomas Roessler
2002-04-29Fix #1171.Thomas Roessler
2002-02-06Avoid a warning on some machines.Thomas Roessler
2002-02-06Make some scanf formats safe.Thomas Roessler
2002-02-05Use strcoll for the file browser. From David Champion.Thomas Roessler
2001-06-07Gettext update.Thomas Roessler
2000-05-22Add mutt_str_adjust ().Thomas Roessler
2000-05-16mutt_expand_path is now able to escape special characters for use inThomas Roessler
regular expressions. This is needed to make folder-hooks work like intended.
2000-05-09Edmund Grimley Evans' UTF-8 patch.Thomas Roessler
2000-04-22Comment cosmetics. From Martin Michlmayer.Thomas Roessler
2000-03-03The FSF apparently has moved.Thomas Roessler
2000-01-10More copyright cosmetics - noted by Martin Michlmayr <tbm@cyrius.com>.Thomas Roessler
2000-01-06Update copyright notices for unstable.Thomas Roessler
1999-08-20Brendan Cully's latest IMAP clean-up.Thomas Roessler
1999-07-01Various patches from last week, including:Thomas Roessler
- new mh/maildir access code. - subscribe/unsubscribe - various fixes.
1999-06-02Major cutting & pasting: We now have a "real" library in lib.c whichThomas Roessler
can be linked against external programs without much effort.