diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Trim the comments and dead code across the tree
Diffstat (limited to 'source/ui-log.c')
-rw-r--r--source/ui-log.c18
1 file changed, 8 insertions, 10 deletions
diff --git a/source/ui-log.c b/source/ui-log.c
index bbfeb67..5b5dd32 100644
--- a/source/ui-log.c
+++ b/source/ui-log.c
@@ -337,7 +337,7 @@ static char *next_token(char **src)
{
char *token;
- if (!src || !*src)
+ if (!*src)
return NULL;
while (isspace((unsigned char)**src))
(*src)++;
@@ -398,7 +398,6 @@ void cgit_print_commit_decorations(struct commit *commit)
const struct name_decoration *deco;
static char buf[1024];
- buf[sizeof(buf) - 1] = 0;
deco = get_name_decoration(&commit->object);
if (!deco)
return;
@@ -463,10 +462,9 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
tip = disambiguate_ref(tip, &must_free_tip);
if (tip && tip[0] == '-') {
// setup_revisions() reads a leading-dash argument as an
- // option, so a tip arriving as the id= value "--output=<path>"
- // would be handled by git as a request to write an arbitrary
- // file. No valid ref or object name begins with a dash, so
- // refuse it.
+ // option, so a tip like "--output=<path>" would become a
+ // request to write an arbitrary file. No valid ref or object
+ // name begins with a dash, so refuse it.
cgit_print_error_page(400, "Bad Request", "Invalid revision");
if (must_free_tip)
free((char *)tip);
@@ -484,10 +482,10 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
char *arg;
// Each whitespace separated token is taken as a
- // revision expression and nothing else, since anything
- // starting with a dash would reach setup_revisions as
- // a rev-list option. The tip pushed above goes away
- // because the range supersedes it.
+ // revision expression only, since a leading dash
+ // would reach setup_revisions as a rev-list option.
+ // The tip pushed above goes away, since the range
+ // supersedes it.
strvec_pop(&rev_argv);
while ((arg = next_token(&pattern))) {
if (*arg == '-') {