Commit Diff


commit - b4b04e8813ee1b6cd1f84196b3c9a123eb2c8b47
commit + 4d24b1fdb79bbc3df9ef996250267ba70f189a4d
blob - 070e37a9d1342993266222f1483916a70450a206
blob + 496a69548f10498a0a5ac85226976ec04339b121
--- gotd/gotd.c
+++ gotd/gotd.c
@@ -1763,10 +1763,6 @@ main(int argc, char **argv)
 
 	if (parse_config(confpath, proc_id, &gotd) != 0)
 		return 1;
-
-	if (proc_id == PROC_GOTD &&
-	    (gotd.nrepos == 0 || TAILQ_EMPTY(&gotd.repos)))
-		fatalx("no repository defined in configuration file");
 
 	pw = getpwnam(gotd.user_name);
 	if (pw == NULL)
blob - 9be73f985cd4b495f70ba089cee603ee8afc861d
blob + 8a904e018947db197de77329a4c68cc09742e7f2
--- gotd/parse.y
+++ gotd/parse.y
@@ -744,6 +744,11 @@ parse_config(const char *filename, enum gotd_procid pr
 		}
 	}
 
+	if (proc_id == PROC_GOTD && TAILQ_EMPTY(&gotd->repos)) {
+		log_warnx("no repository defined in configuration file");
+		return (-1);
+	}
+
 	return (0);
 }