nmh-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-commits] Changes to nmh/uip/anno.c


From: Jon Steinhart
Subject: [Nmh-commits] Changes to nmh/uip/anno.c
Date: Wed, 07 Dec 2005 16:25:47 -0500

Index: nmh/uip/anno.c
diff -u nmh/uip/anno.c:1.5 nmh/uip/anno.c:1.6
--- nmh/uip/anno.c:1.5  Mon Aug 19 20:50:42 2002
+++ nmh/uip/anno.c      Wed Dec  7 21:25:47 2005
@@ -2,7 +2,7 @@
 /*
  * anno.c -- annotate messages
  *
- * $Id: anno.c,v 1.5 2002/08/19 20:50:42 jon Exp $
+ * $Id: anno.c,v 1.6 2005/12/07 21:25:47 jon Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -81,6 +81,10 @@
     { "number", 2 },
 #define        APPENDSW                12
     { "append", 1 },
+#define        PRESERVESW              13
+    { "preserve", 1 },
+#define        NOPRESERVESW            14
+    { "nopreserve", 3 },
     { NULL, 0 }
 };
 
@@ -100,7 +104,7 @@
     char **argp, **arguments, **msgs;
     struct msgs *mp;
     int                append = 0;             /* append annotations instead 
of default prepend */
-    int                delete = -1;            /* delete header element if set 
*/
+    int                delete = -2;            /* delete header element if set 
*/
     char       *draft = (char *)0;     /* draft file name */
     int                isdf = 0;               /* return needed for m_draft() 
*/
     int                list = 0;               /* list header elements if set 
*/
@@ -190,15 +194,30 @@
 
                    if (argp - arguments == argc - 1 || **argp == '-')
                        number = 1;
+                   
+                   else {
+                       if (strcmp(*argp, "all") == 0)
+                           number = -1;
 
-                   else if (!(number = atoi(*argp++)))
-                       adios (NULL, "missing argument to %s", argp[-2]);
+                       else if (!(number = atoi(*argp)))
+                           adios (NULL, "missing argument to %s", argp[-2]);
+
+                       argp++;
+                   }
 
                    delete = number;
                    continue;
 
                case APPENDSW:          /* append annotations instead of 
default prepend */
                    append = 1;
+                   continue;
+
+               case PRESERVESW:        /* preserve access and modification 
times on annotated message */
+                   annopreserve(1);
+                   continue;
+
+               case NOPRESERVESW:      /* don't preserve access and 
modification times on annotated message (default) */
+                   annopreserve(0);
                    continue;
            }
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]