From c8becc4d099cee8c18ebd967720ce7204311d817 Mon Sep 17 00:00:00 2001 From: pdmef Date: Tue, 11 Oct 2005 06:06:17 +0000 Subject: [PATCH] Rocco Rutte: - merge in latest mutt changes git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@545 e385b8ad-14ed-0310-8656-cc95a2468c6d --- ChangeLog.mutt | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ VERSION.svn | 2 +- configure.in | 2 +- imap/command.c | 3 +-- pgp.c | 16 ++++++------- setenv.c | 47 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 120 insertions(+), 12 deletions(-) create mode 100644 setenv.c diff --git a/ChangeLog.mutt b/ChangeLog.mutt index bc5c973..7923f5d 100644 --- a/ChangeLog.mutt +++ b/ChangeLog.mutt @@ -35,6 +35,68 @@ and attach_ignore_fundamental stripped, some debugging code removed, some bones thrown to check_sec.sh. +2005-10-10 18:26:31 Brendan Cully (brendan) + + * pgp.c: Make PGP decode failure non-fatal when displaying + messages (as opposed to decode-saving them). I think it would be + nicer to include the original text when decryption fails + though... + + * imap/command.c, setenv.c: Accept + as IMAP continuation, not + just + . May close #2106. Feed check_sec candy in setenv.c. + +2005-10-09 20:53:21 Brendan Cully (brendan) + + * configure.in: Now that we always check for ncurses/ncurses.h, + remove /usr special case. + + * configure.in, mutt_curses.h: Tweak ncurses autoconflation to + check for ncurses/ncurses.h everywhere, not just in /usr. With + --with-curses=/usr/local, should Close: #2095. + + * configure.in, setenv.c: Add Russ Allbery's setenv replacement + function. + + * init.h: Correct doc nit for $meta_key, noted by Mark + Weyer. Closes: #2105. + +2005-10-06 06:15:00 Brendan Cully (brendan) + + * browser.c: Sort browser entries after every IMAP browsing + operation instead of just when explicitly requested. Closes: + #2089. + +2005-10-06 05:13:55 Jeff Ito (brendan) + + * smime.c: Add AES ciphers to S/MIME encryption options. Closes: + #2103. + +2005-10-05 19:24:40 David Champion (brendan) + + * doc/manual.xml.head, init.c: Fix 'unattachments'. Closes: #2102. + +2005-10-05 19:20:22 Jeff Ito (brendan) + + * smime.c: S/MIME key selection truncates the last character of + the selected key for no apparent reason. Removed until someone + can justify it. Closes: #2081. + +2005-10-04 19:00:05 Brendan Cully (brendan) + + * init.h: Tweak description of pop_checkinterval slightly. Closes: + #2074. + + * hcache.c: Bump hcache Id for attachment counting patch. + +2005-10-04 06:05:39 David Champion (brendan) + + * Muttrc.head.in, doc/manual.xml.head, doc/muttrc.man.head, + globals.h, hdrline.c, init.c, init.h, mime.h, mutt.h, parse.c, + pattern.c, protos.h, recvattach.c: Attachment counting for index + display (patch-1.5.11.dgc.attach.6). Modifications: attach_recurse + and attach_ignore_fundamental stripped, some debugging code + removed, some bones thrown to check_sec.sh. + 2005-10-04 05:24:00 Sebastien Hinderer (brendan) * pager.c: The following patch has an effect only when the diff --git a/VERSION.svn b/VERSION.svn index 4970e69..fc3dff1 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -544 +545 diff --git a/configure.in b/configure.in index e87f6a3..4ef4a1d 100644 --- a/configure.in +++ b/configure.in @@ -342,7 +342,7 @@ dnl AC_CHECK_TYPE(ssize_t, int) AC_CHECK_FUNCS(fgetpos memmove setegid srand48 strerror) -AC_REPLACE_FUNCS(strcasecmp strdup) +AC_REPLACE_FUNCS(strcasecmp strdup setenv) AC_CHECK_FUNC(getopt) if test $ac_cv_func_getopt = yes; then diff --git a/imap/command.c b/imap/command.c index ac19298..49e4441 100644 --- a/imap/command.c +++ b/imap/command.c @@ -139,9 +139,8 @@ int imap_cmd_step (IMAP_DATA * idata) return IMAP_CMD_BAD; /* server demands a continuation response from us */ - if (!ascii_strncmp (cmd->buf, "+ ", 2)) { + if (cmd->buf[0] == '+') return IMAP_CMD_RESPOND; - } /* tagged completion code */ if (!ascii_strncmp (cmd->buf, cmd->seq, SEQLEN)) { diff --git a/pgp.c b/pgp.c index 74f73a9..3ed7d87 100644 --- a/pgp.c +++ b/pgp.c @@ -104,16 +104,13 @@ void pgp_forget_passphrase (void) } int pgp_use_gpg_agent (void) { - char *tty, *ttybuf; + char *tty; if (!option (OPTUSEGPGAGENT) || !getenv ("GPG_AGENT_INFO")) return 0; - if ((tty = ttyname(0)) && - ((ttybuf = mem_malloc (sizeof("GPG_TTY") + strlen(tty) + 1)))) { - snprintf (ttybuf, sizeof (ttybuf), "GPG_TTY=%s", tty); - putenv (ttybuf); - } + if ((tty = ttyname(0))) + setenv ("GPG_TTY", tty, 0); return 1; } @@ -378,6 +375,7 @@ int pgp_application_pgp_handler (BODY * m, STATE * s) } /* treat empty result as sign of failure */ + /* TODO: maybe on failure mutt should include the original undecoded text. */ if (pgpout) { rewind (pgpout); c = fgetc (pgpout); @@ -387,8 +385,10 @@ int pgp_application_pgp_handler (BODY * m, STATE * s) mutt_error _("Could not decrypt PGP message"); mutt_sleep (1); pgp_void_passphrase (); - rc = -1; - goto out; + if (!(s->flags & M_DISPLAY)) { + rc = -1; + goto out; + } } } diff --git a/setenv.c b/setenv.c new file mode 100644 index 0000000..6dd6c93 --- /dev/null +++ b/setenv.c @@ -0,0 +1,47 @@ +/* $Id$ +** +** Replacement for a missing setenv. +** +** Written by Russ Allbery +** This work is hereby placed in the public domain by its author. +** +** Provides the same functionality as the standard library routine setenv +** for those platforms that don't have it. +*/ + +#include "config.h" + +#include +#include + +int +setenv(const char *name, const char *value, int overwrite) +{ + char *envstring; + + if (!overwrite && getenv(name) != NULL) + return 0; + + /* Allocate memory for the environment string. We intentionally don't + use concat here, or the xmalloc family of allocation routines, since + the intention is to provide a replacement for the standard library + function which sets errno and returns in the event of a memory + allocation failure. */ + envstring = malloc(strlen(name) + 1 + strlen(value) + 1); /* __MEM_CHECKED__ */ + if (envstring == NULL) + return -1; + + /* Build the environment string and add it to the environment using + putenv. Systems without putenv lose, but XPG4 requires it. */ + strcpy(envstring, name); /* __STRCPY_CHECKED__ */ + strcat(envstring, "="); /* __STRCAT_CHECKED__ */ + strcat(envstring, value); /* __STRCAT_CHECKED__ */ + return putenv(envstring); + + /* Note that the memory allocated is not freed. This is intentional; + many implementations of putenv assume that the string passed to + putenv will never be freed and don't make a copy of it. Repeated use + of this function will therefore leak memory, since most + implementations of putenv also don't free strings removed from the + environment (due to being overwritten). */ +} -- 2.20.1