diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-12-08 22:24:13 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-12-08 22:24:13 +0300 |
commit | a5066a0b07deb76327e3e3ea845afc899e256c51 (patch) | |
tree | a3107af36d1982864c3e5d80fb6f7086ba9dd682 /builtin/verify-tag.c | |
parent | 657072f3ac5519f146a947253c9959909b38c293 (diff) | |
parent | 3d5854e765dedfaf2a942e8fa1e950a40f9dcee3 (diff) |
Merge branch 'mg/maint-tag-rfc1991'
* mg/maint-tag-rfc1991:
tag: recognize rfc1991 signatures
tag: factor out sig detection for tag display
tag: factor out sig detection for body edits
verify-tag: factor out signature detection
t/t7004-tag: test handling of rfc1991 signatures
Diffstat (limited to 'builtin/verify-tag.c')
-rw-r--r-- | builtin/verify-tag.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c index 8136dba7a1..3134766049 100644 --- a/builtin/verify-tag.c +++ b/builtin/verify-tag.c @@ -17,13 +17,11 @@ static const char * const verify_tag_usage[] = { NULL }; -#define PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----" - static int run_gpg_verify(const char *buf, unsigned long size, int verbose) { struct child_process gpg; const char *args_gpg[] = {"gpg", "--verify", "FILE", "-", NULL}; - char path[PATH_MAX], *eol; + char path[PATH_MAX]; size_t len; int fd, ret; @@ -37,11 +35,7 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose) close(fd); /* find the length without signature */ - len = 0; - while (len < size && prefixcmp(buf + len, PGP_SIGNATURE)) { - eol = memchr(buf + len, '\n', size - len); - len += eol ? eol - (buf + len) + 1 : size - len; - } + len = parse_signature(buf, size); if (verbose) write_in_full(1, buf, len); |