]> diplodocus.org Git - nmh/blobdiff - uip/picksbr.c
Support iCalendar event request files that don't end with a newline.
[nmh] / uip / picksbr.c
index e6108ef7dc1e6e0fc82e4651a970b72504b15a80..21777ed990550d939042ee1fea6a8ef554d68408 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * picksbr.c -- routines to help pick along...
+/* picksbr.c -- routines to help pick along...
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -64,7 +62,7 @@ DEFINE_SWITCH_ARRAY(PARSE, parswit);
 
 #define        STAR    01
 
-#define LBSIZE  1024
+#define LBSIZE  NMH_BUFSIZ
 #define        ESIZE   1024
 
 
@@ -200,7 +198,7 @@ pcompile (char **vec, char *date)
     talked = 0;
 
     if ((head = parse ()) == NULL)
-       return (talked ? 0 : 1);
+        return !talked;
 
     if (*argp) {
        inform("%s unexpected", *argp);
@@ -683,21 +681,18 @@ plist
                    --p2;
                    break;
                }
-               else
-                   lf = 0;
+                lf = 0;
            }
            if (c == '\n') {
                if (body)
                    break;
-               else {
-                   if (lf) {
-                       body++;
-                       break;
-                   }
-                   lf++;
-                   /* Unfold by skipping the newline. */
-                   c = 0;
-               }
+                if (lf) {
+                    body++;
+                    break;
+                }
+                lf++;
+                /* Unfold by skipping the newline. */
+                c = 0;
            }
            if (c && p1 < &linebuf[LBSIZE - 1])
                *p1++ = c;
@@ -843,7 +838,7 @@ tcompile (char *ap, struct tws *tb, int isafter)
     if ((tw = tws_parse (ap, isafter)) == NULL)
        return 0;
 
-    twscopy (tb, tw);
+    *tb = *tw;
     return 1;
 }
 
@@ -935,7 +930,7 @@ plist
 {
     int state;
     char *bp;
-    char buf[BUFSIZ], name[NAMESZ];
+    char buf[NMH_BUFSIZ], name[NAMESZ];
     struct tws *tw;
     m_getfld_state_t gstate = 0;
     NMH_UNUSED (stop);