]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Don't read MOTD file twice
authorAlexander Barton <alex@barton.de>
Tue, 18 Jan 2011 21:01:27 +0000 (22:01 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 18 Jan 2011 21:01:27 +0000 (22:01 +0100)
The MOTD file is read in Read_Config(), so don't read it when handling
the "MotdFile" configuration variable. Instead make sure that it is
initialized properly when (re-)reading the configuration.

src/ngircd/conf.c

index 32846faa052002f068b41cf628ebc15d71bfb60a..fa22df051c3addaa9ab029bd44dbad3197c65b89 100644 (file)
@@ -641,6 +641,9 @@ Set_Defaults(bool InitServers)
                for (i = 0; i < MAX_SERVERS;
                     Init_Server_Struct(&Conf_Server[i++]));
        }
+
+       /* Free MOTD; this is important when reloading the configuration */
+       array_free(&Conf_Motd);
 } /* Set_Defaults */
 
 
@@ -1016,7 +1019,6 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
                len = strlcpy( Conf_MotdFile, Arg, sizeof( Conf_MotdFile ));
                if (len >= sizeof( Conf_MotdFile ))
                        Config_Error_TooLong( Line, Var );
-               Read_Motd(Arg);
                return;
        }
        if( strcasecmp( Var, "MotdPhrase" ) == 0 ) {