stop APPEND and PREPEND at empty line or '#EXIT:'
authorChristian Thaeter <ct@pipapo.org>
Thu, 25 Oct 2007 01:07:09 +0000 (03:07 +0200)
committerChristian Thaeter <ct@pipapo.org>
Thu, 25 Oct 2007 01:07:09 +0000 (03:07 +0200)
src/rxpd_connection_cmd.c

index c447692..62649b5 100644 (file)
@@ -78,7 +78,7 @@ rxpd_connection_APPEND_PREPEND_helper (struct rxpd_connection* self)
 
   while ((line = rxpd_buffer_readline (&self->in)))
     {
-      if (*line)
+      if (*line && strncmp (line, "#EXIT:", sizeof ("#EXIT:")-1))
         {
           struct rxpd_rule* rule;
           rule = rxpd_rule_new (line);
@@ -87,6 +87,8 @@ rxpd_connection_APPEND_PREPEND_helper (struct rxpd_connection* self)
 
           llist_insert_tail (&self->tmp_list, &rule->node);
         }
+      else
+        break;  /* exit at empty line, error or whatever */
     }
 
   if (rxpd_buffer_state (&self->in) == RXPD_ERROR)