commit - 7b0db533fcb3c8284a79a9c3af604ff417d5aee9
commit + 27192be7d3638a3204530c959b4cef6de89e5b74
blob - f232ec2041c71409aefb827816288937fd605184
blob + 62e80e12912672b7ae26c991e774113ec9a14bfd
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
char *parent_id; /* id_str2 */
char *tree_id;
const char *author;
- char *committer;
+ const char *committer;
char *commit_msg;
time_t committer_time;
};
const char *);
static const struct got_error *gw_gen_committer_header(struct gw_trans *,
const char *);
-static char *gw_gen_committer_header_old(char *);
+static char *gw_gen_committer_header_old(const char *);
static char *gw_gen_commit_msg_header(char *);
static char *gw_gen_tree_header(char *);
return return_html;
}
+/* XXX: slated for deletion */
static char *
gw_gen_author_header_old(const char *str)
{
+ const struct got_error *error = NULL;
char *return_html = NULL;
+ char *escaped_html = NULL;
- if (asprintf(&return_html, header_author_html, str) == -1)
+ error = gw_html_escape(&escaped_html, str);
+ if (error)
return_html = strdup("");
+ if (asprintf(&return_html, header_author_html, escaped_html) == -1)
+ return_html = strdup("");
+ free(escaped_html);
return return_html;
}
return error;
}
+/* XXX: slated for deletion */
static char *
-gw_gen_committer_header_old(char *str)
+gw_gen_committer_header_old(const char *str)
{
+ const struct got_error *error = NULL;
char *return_html = NULL;
+ char *escaped_html = NULL;
- if (asprintf(&return_html, header_committer_html, str) == -1)
+ error = gw_html_escape(&escaped_html, str);
+ if (error)
+ return_html = strdup("");
+ if (asprintf(&return_html, header_committer_html, escaped_html) == -1)
return_html = strdup("");
+ free(escaped_html);
return return_html;
}
free(header->commit_id);
free(header->parent_id);
free(header->tree_id);
- free(header->committer);
free(header->commit_msg);
}
header->author =
got_object_commit_get_author(header->commit);
- error = gw_html_escape(&header->committer,
- got_object_commit_get_committer(header->commit));
+ header->committer =
+ got_object_commit_get_committer(header->commit);
if (error)
return error;