Don't list _sysconfdir/ directory in RPM spec. We don't list any other directories...
[mmh] / uip / comp.c
index 2eea08a..c8189d1 100644 (file)
@@ -49,6 +49,8 @@ static struct swit switches[] = {
     { "fcc mailbox", 0 },
 #define WIDTHSW                      17
     { "width colums", 0 },
+#define SUBJECTSW             18
+    { "subject text", 0 },
     { NULL, 0 }
 };
 
@@ -87,12 +89,13 @@ int
 main (int argc, char **argv)
 {
     int use = NOUSE, nedit = 0, nwhat = 0;
-    int i, in = NOTOK, isdf = 0, out, dat[5], ncomps, format_len;
+    int i, in = NOTOK, isdf = 0, out, dat[5], format_len;
     int outputlinelen = OUTPUTLINELEN;
     char *cp, *cwd, *maildir, *dfolder = NULL;
     char *ed = NULL, *file = NULL, *form = NULL;
     char *folder = NULL, *msg = NULL, buf[BUFSIZ];
     char *to = NULL, *from = NULL, *cc = NULL, *fcc = NULL, *dp;
+    char *subject = NULL;
     char drft[BUFSIZ], **argp, **arguments;
     struct msgs *mp = NULL;
     struct format *fmt;
@@ -219,6 +222,12 @@ main (int argc, char **argv)
                    if ((outputlinelen = atoi(cp)) < 10)
                        adios (NULL, "impossible width %d", outputlinelen);
                    continue;
+
+               case SUBJECTSW:
+                   if (!(cp = *argp++) || *cp == '-')
+                       adios (NULL, "missing argument to %s", argp[-2]);
+                   subject = cp;
+                   continue;
            }
        }
        if (*cp == '+' || *cp == '@') {
@@ -291,7 +300,7 @@ main (int argc, char **argv)
 
         cp = new_fs(form, NULL, NULL);
        format_len = strlen(cp);
-       ncomps = fmt_compile(cp, &fmt);
+       fmt_compile(cp, &fmt);
 
        /*
         * Set up any components that were fed to us on the command line
@@ -317,6 +326,11 @@ main (int argc, char **argv)
            if (cptr)
                cptr->c_text = fcc;
        }
+       if (subject) {
+           FINDCOMP(cptr, "subject");
+           if (cptr)
+               cptr->c_text = subject;
+       }
     }
 
 try_it_again: