Merge branch 'jk/skip-prefix'
* jk/skip-prefix: http-push: refactor parsing of remote object names imap-send: use skip_prefix instead of using magic numbers use skip_prefix to avoid repeated calculations git: avoid magic number with skip_prefix fetch-pack: refactor parsing in get_ack fast-import: refactor parsing of spaces stat_opt: check extra strlen call daemon: use skip_prefix to avoid magic numbers fast-import: use skip_prefix for parsing input use skip_prefix to avoid repeating strings use skip_prefix to avoid magic numbers transport-helper: avoid reading past end-of-string fast-import: fix read of uninitialized argv memory apply: use skip_prefix instead of raw addition refactor skip_prefix to return a boolean avoid using skip_prefix as a boolean daemon: mark some strings as const parse_diff_color_slot: drop ofs parameter
This commit is contained in:
6
commit.c
6
commit.c
@ -614,8 +614,7 @@ static void record_author_date(struct author_date_slab *author_date,
|
||||
|
||||
for (buf = buffer; buf; buf = line_end + 1) {
|
||||
line_end = strchrnul(buf, '\n');
|
||||
ident_line = skip_prefix(buf, "author ");
|
||||
if (!ident_line) {
|
||||
if (!skip_prefix(buf, "author ", &ident_line)) {
|
||||
if (!line_end[0] || line_end[1] == '\n')
|
||||
return; /* end of header */
|
||||
continue;
|
||||
@ -1237,8 +1236,7 @@ static void parse_gpg_output(struct signature_check *sigc)
|
||||
for (i = 0; i < ARRAY_SIZE(sigcheck_gpg_status); i++) {
|
||||
const char *found, *next;
|
||||
|
||||
found = skip_prefix(buf, sigcheck_gpg_status[i].check + 1);
|
||||
if (!found) {
|
||||
if (!skip_prefix(buf, sigcheck_gpg_status[i].check + 1, &found)) {
|
||||
found = strstr(buf, sigcheck_gpg_status[i].check);
|
||||
if (!found)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user