commit - b4fba4482d92ba322d5d99ef73d99c0415c46005
commit + 2447adadc132d750c8e3542a3ccbab8ba0c66691
blob - e05599b244c90e3d1a70b36f9596765c33a42aed
blob + 2f418b3fa12c28836eec8000d59c377b252aa496
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
kerr = khttp_puts(gw_trans->gw_req, blame);
if (kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
done:
got_ref_list_free(&header->refs);
gw_free_headers(header);
kerr = khttp_write(gw_trans->gw_req, content, filesize);
if (kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
done:
got_ref_list_free(&header->refs);
gw_free_headers(header);
free(age);
free(escaped_commit_msg);
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
kerr = khttp_puts(gw_trans->gw_req, index_projects_header);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
if (TAILQ_EMPTY(&gw_trans->gw_dirs)) {
if (asprintf(&html, index_projects_empty,
return got_error_from_errno("asprintf");
kerr = khttp_puts(gw_trans->gw_req, html);
if (kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
free(html);
return error;
}
free(navs);
free(html);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
if (gw_trans->gw_conf->got_max_repos_display == 0)
continue;
if (next_disp == gw_trans->gw_conf->got_max_repos_display) {
kerr = khttp_puts(gw_trans->gw_req, np_wrapper_start);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
} else if ((gw_trans->gw_conf->got_max_repos_display > 0) &&
(gw_trans->page > 0) &&
(next_disp == gw_trans->gw_conf->got_max_repos_display ||
prev_disp == gw_trans->repos_total)) {
kerr = khttp_puts(gw_trans->gw_req, np_wrapper_start);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
}
if ((gw_trans->gw_conf->got_max_repos_display > 0) &&
kerr = khttp_puts(gw_trans->gw_req, prev);
free(prev);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
}
kerr = khttp_puts(gw_trans->gw_req, div_end);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
if (gw_trans->gw_conf->got_max_repos_display > 0 &&
next_disp == gw_trans->gw_conf->got_max_repos_display &&
kerr = khttp_puts(gw_trans->gw_req, next);
free(next);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
kerr = khttp_puts(gw_trans->gw_req, div_end);
if (kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
next_disp = 0;
break;
}
prev_disp == gw_trans->repos_total)) {
kerr = khttp_puts(gw_trans->gw_req, div_end);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
}
next_disp++;
free(href_tree);
free(escaped_commit_msg);
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
free(href_diff);
free(href_tree);
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV, KATTR_ID,
"summary_wrapper", KATTR__MAX);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
/* description */
if (gw_trans->gw_conf->got_show_repo_description &&
free(tags);
free(heads);
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
kerr = khttp_puts(gw_trans->gw_req, tree);
if (kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
done:
got_ref_list_free(&header->refs);
gw_free_headers(header);
kerr = khttp_puts(gw_trans->gw_req, tag);
if (kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
done:
got_ref_list_free(&header->refs);
gw_free_headers(header);
kerr = khttp_head(gw_trans->gw_req, kresps[KRESP_ALLOW], "GET");
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
kerr = khttp_head(gw_trans->gw_req, kresps[KRESP_STATUS], "%s",
khttps[code]);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
kerr = khttp_head(gw_trans->gw_req, kresps[KRESP_CONTENT_TYPE], "%s",
kmimetypes[mime]);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
kerr = khttp_head(gw_trans->gw_req, "X-Content-Type-Options",
"nosniff");
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
kerr = khttp_head(gw_trans->gw_req, "X-Frame-Options", "DENY");
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
kerr = khttp_head(gw_trans->gw_req, "X-XSS-Protection",
"1; mode=block");
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
if (gw_trans->mime == KMIME_APP_OCTET_STREAM) {
kerr = khttp_head(gw_trans->gw_req,
kresps[KRESP_CONTENT_DISPOSITION],
"attachment; filename=%s", gw_trans->repo_file);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
}
kerr = khttp_body(gw_trans->gw_req);
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
}
static const struct got_error *
kerr = khtml_open(gw_trans->gw_html_req, gw_trans->gw_req, 0);
if (kerr != KCGI_OK)
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
if (gw_trans->action != GW_BLOB) {
kerr = khttp_template(gw_trans->gw_req, gw_trans->gw_tmpl,
gw_query_funcs[gw_trans->action].template);
if (kerr != KCGI_OK) {
khtml_close(gw_trans->gw_html_req);
- return gw_kcgi_error(kerr != KCGI_OK);
+ return gw_kcgi_error(kerr);
}
}
goto done;
done:
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
goto done;
done:
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
goto done;
done:
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
goto done;
done:
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
goto done;
done:
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
goto done;
done:
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
goto done;
done:
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
free(id2);
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV, KATTR_ID,
"diff_line", KATTR_CLASS, color ? color : "", KATTR__MAX);
if (error == NULL && kerr != KCGI_OK)
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
return error;
}
kerr = khttp_parse(gw_trans->gw_req, gw_keys, KEY__ZMAX, &page, 1, 0);
if (kerr != KCGI_OK) {
- error = gw_kcgi_error(kerr != KCGI_OK);
+ error = gw_kcgi_error(kerr);
goto done;
}