Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Tue, 26 Jul 2005 15:26:23 +0000 (15:26 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Tue, 26 Jul 2005 15:26:23 +0000 (15:26 +0000)
- merge in latest mutt changes

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@347 e385b8ad-14ed-0310-8656-cc95a2468c6d

ChangeLog.mutt
doc/manual.sgml.head
imap/imap.c
imap/imap_private.h
mbyte.c
mutt_ssl.c
pattern.c

index b74b40a..005c223 100644 (file)
@@ -1,3 +1,35 @@
+2005-07-26 06:14:34  "Brent J. Nordquist"  <brent@nordist.net>  (brendan)
+
+       * doc/manual.sgml.head: Correct a couple of typos (and change
+       &hyphen; to -: although the text version of the manual renders
+       &hyphen;, the web version does not).
+
+2005-07-26 05:58:29  TAKAHASHI Tamotsu  <ttakah@lapis.plala.or.jp>  (brendan)
+
+       * pattern.c: Interpret an empty limit as a request to cancel the
+       current limit. (Closes #1854)
+
+2005-07-26 05:28:02  Brendan Cully  <brendan@kublai.com>  (brendan)
+
+       * mutt_ssl.c: Don't offer to save expired or not-yet-valid
+       certificates. Closes #1943 as a side-effect.
+
+2005-07-26 05:04:23  Brendan Cully  <brendan@kublai.com>  (brendan)
+
+       * imap/imap.c, imap/imap_private.h: Rework IMAP CLOSE handling to
+       avoid expunging messages when exiting without saving changes.
+       (closes #1899)
+
+2005-07-26 03:09:55  Ralf Wildenhues  <wildenhues@ins.uni-bonn.de>  (brendan)
+
+       * mbyte.c, mutt_socket.c: There are some functions without ANSI
+       prototypes left in mutt-owned sources.
+
+2005-07-25 20:07:23  Brendan Cully  <brendan@kublai.com>  (brendan)
+
+       * init.h: Update _MAKEDOC macro so that the documentation includes
+       all variables.
+
 2005-07-25 15:48:36  Thomas Roessler  <roessler@does-not-exist.org>  (roessler)
 
        * copy.c, imap/imap.c, mh.c, mutt.h, muttlib.c, thread.c: Get rid
index f67bfe1..0f3dd6b 100644 (file)
@@ -1852,10 +1852,10 @@ is a caret ``&circ;'' then it matches any character <bf/not/ in the
 list.  For example, the regular expression <bf/&lsqb;0123456789&rsqb;/
 matches any single digit.  A range of ASCII characters may be specified
 by giving the first and last characters, separated by a hyphen
-``&hyphen;''.  Most metacharacters lose their special meaning inside
+``-''.  Most metacharacters lose their special meaning inside
 lists.  To include a literal ``&rsqb;'' place it first in the list.
 Similarly, to include a literal ``&circ;'' place it anywhere but first.
-Finally, to include a literal hyphen ``&hyphen;'' place it last.
+Finally, to include a literal hyphen ``-'' place it last.
 
 Certain named classes of characters are predefined.  Character classes
 consist of ``&lsqb;:'', a keyword denoting the class, and ``:&rsqb;''.
@@ -2096,7 +2096,7 @@ or ``Ed +SomeoneElse'':
  '~s "^Junk +From +Me$" ~f ("Jim +Somebody"|"Ed +SomeoneElse")'
 </verb></tscreen>
 
-Note that if a regular expression contains parenthesis, or a veritical bar
+Note that if a regular expression contains parenthesis, or a vertical bar
 ("|"), you <bf/must/ enclose the expression in double or single quotes since
 those characters are also used to separate different parts of Mutt-ng's
 pattern language.  For example,
index 76d9f8b..40489b4 100644 (file)
@@ -968,13 +968,6 @@ int imap_sync_mailbox (CONTEXT * ctx, int expunge, int *index_hint)
     return -1;
   }
 
-  /* CLOSE purges deleted messages. If we don't want to purge them, we must
-   * tell imap_close_mailbox not to issue the CLOSE command */
-  if (expunge)
-    idata->noclose = 0;
-  else
-    idata->noclose = 1;
-
   /* This function is only called when the calling code expects the context
    * to be changed. */
   imap_allow_reopen (ctx);
@@ -1051,6 +1044,12 @@ int imap_sync_mailbox (CONTEXT * ctx, int expunge, int *index_hint)
     }
   }
 
+  if (ctx->closing) {
+    if (imap_exec (idata, "CLOSE", 0))
+      mutt_error (_("CLOSE failed"));
+    idata->state = IMAP_AUTHENTICATED;
+  }
+
   rc = 0;
 out:
   if (cmd.data)
@@ -1062,7 +1061,7 @@ out:
   return rc;
 }
 
-/* imap_close_mailbox: issue close command if neccessary, reset IMAP_DATA */
+/* imap_close_mailbox: clean up IMAP data in CONTEXT */
 void imap_close_mailbox (CONTEXT * ctx)
 {
   IMAP_DATA *idata;
@@ -1073,13 +1072,17 @@ void imap_close_mailbox (CONTEXT * ctx)
   if (!idata)
     return;
 
-  if ((idata->status != IMAP_FATAL) &&
-      (idata->state == IMAP_SELECTED) && (ctx == idata->ctx)) {
-    if (!(idata->noclose) && imap_exec (idata, "CLOSE", 0))
+  if (ctx == idata->ctx) {
+    if (idata->state = IMAP_SELECTED) {
+      /* mx_close_mailbox won't sync if there are no deleted messages
+      * and the mailbox is unchanged, so we may have to close here */
+      if (idata->status != IMAP_FATAL && !ctx->deleted && 
+          imap_exec (idata, "CLOSE", 0))
       mutt_error (_("CLOSE failed"));
+      idata->state = IMAP_AUTHENTICATED;
+    }
 
     idata->reopen &= IMAP_REOPEN_ALLOW;
-    idata->state = IMAP_AUTHENTICATED;
     FREE (&(idata->mailbox));
     mutt_free_list (&idata->flags);
     idata->ctx = NULL;
index dcf0c96..dd531f8 100644 (file)
@@ -149,7 +149,6 @@ typedef struct {
   unsigned char rights[(RIGHTSMAX + 7) / 8];
   unsigned int newMailCount;
   IMAP_CACHE cache[IMAP_CACHE_LEN];
-  int noclose:1;
 #ifdef USE_HCACHE
   unsigned long uid_validity;
 #endif
diff --git a/mbyte.c b/mbyte.c
index 7940dc4..1ff911c 100644 (file)
--- a/mbyte.c
+++ b/mbyte.c
@@ -431,7 +431,7 @@ size_t utf8rtowc (wchar_t * pwc, const char *s, size_t n, mbstate_t * _ps)
 
 #endif /* !HAVE_WC_FUNCS */
 
-wchar_t replacement_char ()
+wchar_t replacement_char (void)
 {
   return Charset_is_utf8 ? 0xfffd : '?';
 }
index 83b735b..020cd1d 100644 (file)
@@ -590,7 +590,9 @@ static int ssl_check_certificate (sslsockdata * data)
   snprintf (menu->dialog[row++], SHORT_STRING, _("Fingerprint: %s"), buf);
 
   menu->title = _("SSL Certificate check");
-  if (SslCertFile) {
+
+  if (SslCertFile && X509_cmp_current_time (X509_get_notAfter (data->cert)) >= 0
+      && X509_cmp_current_time (X509_get_notBefore (data->cert)) < 0) {
     menu->prompt = _("(r)eject, accept (o)nce, (a)ccept always");
     menu->keys = _("roa");
   }
index 7d70868..5b9c13a 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -1132,9 +1132,14 @@ int mutt_pattern_func (int op, char *prompt)
 
   strfcpy (buf, NONULL (Context->pattern), sizeof (buf));
   if (prompt || op != M_LIMIT)
-    if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0
-        || !buf[0])
+    if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0)
       return (-1);
+  if (!buf[0]) {
+    if (op == M_LIMIT)
+      strncpy (buf, "~A", sizeof (buf));
+    else
+      return (-1);
+  }
 
   mutt_message _("Compiling search pattern...");