[Libpst-commits] r61 - trunk

Joseph Nahmias jello at alioth.debian.org
Mon Dec 11 02:15:19 CET 2006


Author: jello
Date: 2006-12-11 02:15:18 +0100 (Mon, 11 Dec 2006)
New Revision: 61

Modified:
   trunk/readpst.1
   trunk/readpst.c
Log:
Added -b option to readpst to not save the RTF body of emails.
Thanks to James Woodcock for the patch, closes track patch #303572.


Modified: trunk/readpst.1
===================================================================
--- trunk/readpst.1	2006-12-07 23:33:31 UTC (rev 60)
+++ trunk/readpst.1	2006-12-11 01:15:18 UTC (rev 61)
@@ -2,7 +2,7 @@
 .\" First parameter, NAME, should be all caps
 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
 .\" other parameters are allowed: see man(7), man(1)
-.TH READPST 1 "January 11, 2006"
+.TH READPST 1 "December 10, 2006"
 .\" Please adjust this date whenever revising the manpage.
 .\"
 .\" Some roff macros, for reference:
@@ -34,6 +34,9 @@
 .SH OPTIONS
 A summary of options is included below.
 .TP
+.B \-b
+Do not save the attachments for the RTF format of the email body.
+.TP
 .B \-c[lv]
 Set the Contact output mode. Use \fB-cv\fP for vcard format or \fB-cl\fP for
 an email list.

Modified: trunk/readpst.c
===================================================================
--- trunk/readpst.c	2006-12-07 23:33:31 UTC (rev 60)
+++ trunk/readpst.c	2006-12-11 01:15:18 UTC (rev 61)
@@ -150,11 +150,15 @@
   char *attach_filename = NULL;
   int skip_child = 0;
   struct file_ll  *f, *head;
+  int save_rtf_body = 1;
   prog_name = argv[0];
   // }}}2
   // command-line option handling {{{2
-  while ((c = getopt(argc, argv, "d:hko:qrSVwc:"))!= -1) {
+  while ((c = getopt(argc, argv, "bd:hko:qrSVwc:"))!= -1) {
     switch (c) {
+    case 'b':
+      save_rtf_body = 0;
+      break;
     case 'c':
       if (optarg!=NULL && optarg[0]=='v')
 	contact_mode=CMODE_VCARD;
@@ -781,7 +785,7 @@
 
 	attach_num = 0;
 
-	if (item->email->rtf_compressed != NULL) {
+	if ( item->email->rtf_compressed != NULL && save_rtf_body ) {
 	  DEBUG_MAIN(("Adding RTF body as attachment\n"));
 	  item->current_attach = (pst_item_attach*)xmalloc(sizeof(pst_item_attach));
 	  memset(item->current_attach, 0, sizeof(pst_item_attach));
@@ -1146,6 +1150,7 @@
   version();
   printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name);
   printf("OPTIONS:\n");
+  printf("\t-b\t- Don't save RTF-Body attachments\n");
   printf("\t-c[v|l]\t- Set the Contact output mode. -cv = VCard, -cl = EMail list\n");
   printf("\t-d\t- Debug to file. This is a binary log. Use readlog to print it\n");
   printf("\t-h\t- Help. This screen\n");




More information about the Libpst-commits mailing list