summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/blabouncer.c b/blabouncer.c
index d94a165..e6a56c1 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -1025,9 +1025,21 @@ int main(int argc, char *argv[]) {
settings.ircserverpassword[0] = '\0';
}
- // What is the connect command, if any?
- if (!getconfstr("connectcommand", settings.conffile, settings.connectcommand)) {
- settings.connectcommand[0] = '\0';
+ // What are the connect commands, if any?
+ int ret = getconfarr("connectcommands", settings.conffile, settings.connectcommands);
+ if (!ret) {
+ for (int i = 0; i < MAXCONFARR; i++) {
+ settings.connectcommands[i][0] = '\0';
+ }
+ } else if (ret == -1) {
+ // Remove any newlines from the middle of the string so error printing works nicely
+ for (size_t i = 0; i < strlen(settings.connectcommands[0]) - 1; i++) {
+ if (settings.connectcommands[0][i] == '\n') {
+ settings.connectcommands[0][i] = ' ';
+ }
+ }
+ printf("main(): error getting 'commandcommands' from configuration file: %s", settings.connectcommands[0]);
+ exit(1);
}
// Is the base directory set? If not, use the default.