else
else if (ctx->magic == M_MAILDIR && !modified && !strncmp("cur/", ctx->hdrs[i]->path, 4))
int mh_check_mailbox(CONTEXT *ctx, int *index_hint){  char buf[_POSIX_PATH_MAX], b1[LONG_STRING], b2[LONG_STRING];  struct stat st, st_cur;  short modified = 0, have_new = 0;  struct maildir *md, *p;  struct maildir **last;  HASH *fnames;  int i, deleted;    if(!option (OPTCHECKNEW))    return 0;    if(ctx->magic == M_MH)  {    strfcpy(buf, ctx->path, sizeof(buf));    if(stat(buf, &st) == -1)      return -1;  }  else if(ctx->magic == M_MAILDIR)  {    snprintf(buf, sizeof(buf), "%s/new", ctx->path);    if(stat(buf, &st) == -1)      return -1;        snprintf(buf, sizeof(buf), "%s/cur", ctx->path);    if(stat(buf, &st_cur) == -1)      modified = 1;  }    if(!modified && ctx->magic == M_MAILDIR && st_cur.st_mtime > ctx->mtime_cur)    modified = 1;    if(!modified && ctx->magic == M_MH && st.st_mtime > ctx->mtime)    modified = 1;    if(modified || (ctx->magic == M_MAILDIR && st.st_mtime > ctx->mtime))    have_new = 1;    if(!modified && !have_new)    return 0;  if(ctx->magic == M_MAILDIR)    ctx->mtime_cur = st_cur.st_mtime;  ctx->mtime = st.st_mtime;#if 0  if(Sort != SORT_ORDER)  {    short old_sort;        old_sort = Sort;    Sort = SORT_ORDER;    mutt_sort_headers(ctx, 1);    Sort = old_sort;  }#endif  md = NULL;  last = &md;    if(ctx->magic == M_MAILDIR)  {    if(have_new || modified)      maildir_parse_dir(ctx, &last, "new", NULL);    if(modified)      maildir_parse_dir(ctx, &last, "cur", NULL);  }  else if(ctx->magic == M_MH)    maildir_parse_dir(ctx, &last, NULL, NULL);  /* check for modifications and adjust flags */  fnames = hash_create(1024);    for(p = md; p; p = p->next)  {    if(ctx->magic == M_MAILDIR)    {      maildir_canon_filename(b2, p->h->path, sizeof(b2));      p->canon_fname = safe_strdup(b2);    }    else      p->canon_fname = safe_strdup(p->h->path);        hash_insert(fnames, p->canon_fname, p, 0);  }  deleted = 0;    for(i = 0; i < ctx->msgcount; i++)  {    ctx->hdrs[i]->active = 0;    if(ctx->magic == M_MAILDIR)      maildir_canon_filename(b1, ctx->hdrs[i]->path, sizeof(b1));    else      strfcpy(b1, ctx->hdrs[i]->path, sizeof(b1));    dprint(2, (debugfile, "%s:%d: mh_check_mailbox(): Looking for %s.\n", __FILE__, __LINE__, b1));        if((p = hash_find(fnames, b1)) && p->h &&       mbox_strict_cmp_headers(ctx->hdrs[i], p->h))    {      /* found the right message */      dprint(2, (debugfile, "%s:%d: Found.  Flags before: %s%s%s%s%s\n", __FILE__, __LINE__,		 ctx->hdrs[i]->flagged ? "f" : "",		 ctx->hdrs[i]->deleted ? "D" : "",		 ctx->hdrs[i]->replied ? "r" : "",		 ctx->hdrs[i]->old     ? "O" : "",		 ctx->hdrs[i]->read    ? "R" : ""));      if(modified)      {	if(!ctx->hdrs[i]->changed)	{	  mutt_set_flag (ctx, ctx->hdrs[i], M_FLAG, p->h->flagged);	  mutt_set_flag (ctx, ctx->hdrs[i], M_REPLIED, p->h->replied);	  mutt_set_flag (ctx, ctx->hdrs[i], M_READ, p->h->read);	}	/* 	 * This flag relates to file positions for maildir folders,	 * so we _must_ use the modified folder's value here.	 * Otherwise, the mail folder will appear to be corrupted.	 */	mutt_set_flag(ctx, ctx->hdrs[i], M_OLD, p->h->old);      }      ctx->hdrs[i]->active = 1;      dprint(2, (debugfile, "%s:%d:         Flags after: %s%s%s%s%s\n", __FILE__, __LINE__,		 ctx->hdrs[i]->flagged ? "f" : "",		 ctx->hdrs[i]->deleted ? "D" : "",		 ctx->hdrs[i]->replied ? "r" : "",		 ctx->hdrs[i]->old     ? "O" : "",		 ctx->hdrs[i]->read    ? "R" : ""));      mutt_free_header(&p->h);    }    else    {            dprint(2, (debugfile, "%s:%d: Not found.  Flags were: %s%s%s%s%s\n", __FILE__, __LINE__,		 ctx->hdrs[i]->flagged ? "f" : "",		 ctx->hdrs[i]->deleted ? "D" : "",		 ctx->hdrs[i]->replied ? "r" : "",		 ctx->hdrs[i]->old     ? "O" : "",		 ctx->hdrs[i]->read    ? "R" : ""));            /* the message has disappeared by occult forces, correct       * the index hint.        */      if(modified && index_hint && (i < *index_hint))	deleted++;    }    if(modified && index_hint && i == *index_hint)      *index_hint -= deleted;  }  hash_destroy(&fnames, NULL);      if(modified)    mx_update_tables(ctx, 0);  maildir_move_to_context(ctx, &md);    return modified ? M_REOPENED : have_new ? M_NEW_MAIL : 0;}