summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/blabouncer.c b/blabouncer.c
index 59cf8c1..8ed8d72 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -1375,7 +1375,14 @@ int main(int argc, char *argv[]) {
exit(1);
} else {
// If none provided, set to default
- strcpy(settings.conffile, "blabouncer.conf");
+ snprintf(settings.conffile, PATH_MAX, "%s/.blabouncer/blabouncer.conf", getenv("HOME"));
+ // Since this is the default, it might not exist yet, so let's check...
+ struct stat st = {0};
+ if (stat(settings.conffile, &st) == -1) {
+ // ...it doesn't exist, so let's create it
+ printf("Creating default configuration file '%s'.\n", settings.conffile);
+ createconfigfile(settings.conffile);
+ }
}
printf("Using configuration file '%s'.\n", settings.conffile);