]> diplodocus.org Git - nmh/blobdiff - sbr/icalendar.l
new.c: Order two return statements to match comment.
[nmh] / sbr / icalendar.l
index c1e2162b3640f8f9c6f1bb10faa81835c7e68192..3a6522ce61fb9f5bf0d1456bb21d82032c06a528 100644 (file)
 #include "h/mh.h"
 #include "h/icalendar.h"
 #include "sbr/icalparse.h"
+#include "sbr/base64.h"
 
 static char *unfold (char *, size_t *);
-static void destroy_icallex ();
+static void destroy_icallex(void);
 %}
 
 /*
@@ -257,7 +258,15 @@ folded-value         {VALUE-CHAR}*({fold}{VALUE-CHAR}*)+
 
 . {
     /* By default, flex will just pass unmatched text.  Catch it instead. */
-    inform("unexpected input: |%s|\n", icaltext);
+    contentline *clines = vevents.last->contentlines;
+    contentline *cline;
+
+    if (clines  &&  (cline = clines->last)) {
+        if (cline->unexpected == NULL) {
+            cline->unexpected = charstring_create (0);
+        }
+        charstring_append_cstring (cline->unexpected, icaltext);
+    }
 }
 
 <INITIAL>
@@ -312,7 +321,7 @@ unfold (char *text, size_t *leng) {
  * with something other than flex.
  */
 static void
-destroy_icallex () {
+destroy_icallex(void) {
 #if defined FLEX_SCANNER  &&  defined YY_FLEX_SUBMINOR_VERSION
     /* Hack:  rely on fact that the the YY_FLEX_SUBMINOR_VERSION
        #define was added to flex (flex.skl v. 2.163) after