# HG changeset patch
# User Markus Bröker <mbroeker@largo.dyndns.tv>
# Date 1229179129 -3600
# Node ID 3152de03758e09918f1eac3f5663c649ce88ae55
# Parent  b04ef0b1cd3b297c126abf27bcf01f7fb6b002b3
A critical change was introduced here...

After securing the runtime behaviour 2 commits ago by inserting a
feof(stream) { ... } there is no need for short active = 0|1 anymore.

committer: Markus Bröker <mbroeker@largo.homelinux.org>

diff --git a/include/mcbot.h b/include/mcbot.h
--- a/include/mcbot.h
+++ b/include/mcbot.h
@@ -15,5 +15,5 @@
 #include <irc.h>
 #endif
 
-char *parse (MSG *, short *);
+char *parse (MSG *);
 #endif
diff --git a/src/main.c b/src/main.c
--- a/src/main.c
+++ b/src/main.c
@@ -29,12 +29,9 @@
 #define LOCALE_PATH "/var/lib/nobody/data/locale"
 #endif
 
-short active = 1;
-
 void sigproc ()
 {
     signal (SIGTERM, sigproc);
-    active = 0;
 }
 
 int main (int argc, char **argv)
@@ -105,7 +102,7 @@
         if ((command = irc_parsemessage (buf, &message))) {
             printf ("%10s %s %s\n", command, message.channel, message.line);
         } else {
-            if ((msg = parse (&message, &active)) != NULL) {
+            if ((msg = parse (&message)) != NULL) {
                 fprintf (message.stream, "%s\r\n", msg);
                 printf ("%10s %s", "WRITE", msg);
             }
diff --git a/src/parse.c b/src/parse.c
--- a/src/parse.c
+++ b/src/parse.c
@@ -54,7 +54,7 @@
     NULL,
 };
 
-char *parse (MSG * message, short *active)
+char *parse (MSG * message)
 {
     static char msg[513];
     int cmd = -1;
@@ -213,7 +213,6 @@
                     if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) {
                         snprintf (msg, 512, "PRIVMSG %s :%s!\r\nQUIT\r\n", message->channel,
                                   gettext ("Bye, have a nice day!"));
-                        *active = 0;
                     }
                 }
                 /*