commit - cc88020e952af813c1e01b91ab6516969562e972
commit + 859316d03c1ee64b2c2fd2787e727daadf60bcf3
blob - d2433c74f9a4a7dda902b7cb09f1acc7b78ff8d8
blob + 86df002974199b257619f65568a8d0fe77f560af
--- gotd/parse.y
+++ gotd/parse.y
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);