make tests easier to read

This commit is contained in:
prx 2022-08-17 21:34:37 +02:00
parent 26ca6c422d
commit 883bfed7a7
1 changed files with 8 additions and 6 deletions

6
vger.c
View File

@ -514,14 +514,16 @@ split_request(const char *request, char *hostname, char *path, char *query)
char buf[BUFSIZ] = {'\0'}; /* to handle error messages */
int ret = 0;
if ((ret = regcomp(&greg, gemini_regex, REG_EXTENDED)) != 0) {
ret = regcomp(&greg, gemini_regex, REG_EXTENDED);
if (ret != 0) {
regerror(ret, &greg, buf, sizeof(buf));
regfree(&greg);
status(50, "Internal server error");
stop(EXIT_FAILURE, "%s", buf);
}
if ((ret = regexec(&greg, request, nmatch, match, 0)) != 0) {
ret = regexec(&greg, request, nmatch, match, 0);
if (ret != 0) {
regerror(ret, &greg, buf, sizeof(buf));
regfree(&greg);
status(59, "Malformed request");