/[mailutils]/mailutils/mail/util.c
ViewVC logotype

Diff of /mailutils/mail/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.46 by gray, Thu Oct 3 14:33:30 2002 UTC revision 1.47 by gray, Sun Oct 13 20:35:46 2002 UTC
# Line 563  util_setenv (const char *variable, void Line 563  util_setenv (const char *variable, void
563   * return 1 if a message is deleted   * return 1 if a message is deleted
564   */   */
565  int  int
566  util_isdeleted (int n)  util_isdeleted (message_t msg)
567  {  {
   message_t msg;  
568    attribute_t attr;    attribute_t attr;
569    if (mailbox_get_message (mbox, n, &msg) != 0)  
     return 0;  
570    message_get_attribute (msg, &attr);    message_get_attribute (msg, &attr);
571    if (attribute_is_deleted (attr))    return attribute_is_deleted (attr);
     return 1;  
   return 0;  
572  }  }
573    
574  char *  char *
# Line 918  util_save_outgoing (message_t msg, char Line 914  util_save_outgoing (message_t msg, char
914                    off += n;                    off += n;
915                  }                  }
916                free (buf);                free (buf);
917                  fprintf (outfile, "\n");
918              }              }
919            fclose (outfile);            fclose (outfile);
920          }          }
# Line 1226  util_header_expand (header_t *phdr) Line 1223  util_header_expand (header_t *phdr)
1223    
1224    return errcnt;    return errcnt;
1225  }  }
1226    
1227    int
1228    util_get_message (mailbox_t mbox, size_t msgno, message_t *msg, int delflag)
1229    {
1230      int status;
1231    
1232      if (msgno > total)
1233        {
1234          util_error_range (msgno);
1235          return ENOENT;
1236        }
1237      
1238      status = mailbox_get_message (mbox, msgno, msg);
1239      if (status)
1240        {
1241          util_error ("can't get message %lu: %s",
1242                      (unsigned long) msgno, mu_errstring (status));
1243          return status;
1244        }
1245    
1246      if (delflag && util_isdeleted (*msg))
1247        {
1248          util_error ("%d: Inappropriate message (has been deleted)");
1249          return ENOENT;
1250        }
1251      return 0;
1252    }
1253    
1254    int
1255    util_error_range (size_t msgno)
1256    {
1257      util_error ("%d: invalid message number", msgno);
1258      return 1;
1259    }

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26