Commit Diff


commit - f9542c24c5340ee3ab60b432efa61c97bcc04381
commit + d95864cd5d79ee17fbd13a3ab18ffd394b27f83a
blob - 7194fcd4fc0a0849d456781ccae9c9b86c49448b
blob + eb736f63ba59501f38728a4c2a6c5c0c4a1e7eec
--- gotd/parse.y
+++ gotd/parse.y
@@ -309,9 +309,19 @@ repoopts1	: PATH STRING {
 					YYERROR;
 				}
 				if (realpath($2, new_repo->path) == NULL) {
-					yyerror("realpath %s: %s", $2, strerror(errno));
-					free($2);
-					YYERROR;
+					yyerror("realpath %s: %s", $2,
+					    strerror(errno));
+					/*
+					 * Give admin a chance to create
+					 * missing repositories at run-time.
+					 */
+					if (errno != ENOENT) {
+						free($2);
+						YYERROR;
+					} else if (strlcpy(new_repo->path, $2,
+					    sizeof(new_repo->path)) >=
+					    sizeof(new_repo->path))
+						yyerror("path too long");
 				}
 			}
 			free($2);