commit - dda76f1836d14f05a7f1ff0ea0fa2b1d191fce2c
commit + 4d6abe2b984fb93fee0027acd0a674d80afb249b
blob - 726420c12a4d8e5f7135155b6ef2d3cf6c7c8761
blob + 98f695488abbedcc754b8ce7f1b2f0d86bdb1b42
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
const char *repo_name;
char *repo_path;
char *commit;
- char *repo_file;
+ const char *repo_file;
char *repo_folder;
char *headref;
unsigned int action;
return got_error_from_errno("asprintf");
}
- if ((p = gw_trans->gw_req->fieldmap[KEY_FILE])) {
- if (asprintf(&gw_trans->repo_file, "%s",
- p->parsed.s) == -1)
- return got_error_from_errno("asprintf");
- }
+ if ((p = gw_trans->gw_req->fieldmap[KEY_FILE]))
+ gw_trans->repo_file = p->parsed.s;
if ((p = gw_trans->gw_req->fieldmap[KEY_FOLDER])) {
if (asprintf(&gw_trans->repo_folder, "%s",
if (kerr != KCGI_OK)
return gw_kcgi_error(kerr);
+ /* XXX repo_file could be NULL if not present in querystring */
if (gw_trans->mime == KMIME_APP_OCTET_STREAM) {
kerr = khttp_head(gw_trans->gw_req,
kresps[KRESP_CONTENT_DISPOSITION],
"blame_hash", KATTR__MAX);
if (kerr != KCGI_OK)
goto err;
+ /* XXX repo_file could be NULL if not present in querystring */
if (asprintf(&href_diff,
"?path=%s&action=diff&commit=%s&file=%s&folder=%s",
a->gw_trans->repo_name, bline->id_str,
if (error)
return error;
+ /* XXX repo_file could be NULL if not present in querystring */
if (asprintf(&path, "%s%s%s",
gw_trans->repo_folder ? gw_trans->repo_folder : "",
gw_trans->repo_folder ? "/" : "",
if (error)
return error;
+ /* XXX repo_file could be NULL if not present in querystring */
if (asprintf(&path, "%s%s%s",
gw_trans->repo_folder ? gw_trans->repo_folder : "",
gw_trans->repo_folder ? "/" : "",
free(gw_trans->gw_conf);
free(gw_trans->commit);
free(gw_trans->repo_path);
- free(gw_trans->repo_file);
free(gw_trans->headref);
TAILQ_FOREACH_SAFE(dir, &gw_trans->gw_dirs, entry, tdir) {