X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-verify-tag.c;h=92eaa89a45eff2e76e531a914bdccca5fafe98b0;hb=d88593fa0412a4f0a363860d879e97635c118616;hp=dfcfcd0455ce471a6120d11bcbdb7553de59f536;hpb=9656153b87d47b34986f2d77eef9199c24cbf9f6;p=git.git diff --git a/builtin-verify-tag.c b/builtin-verify-tag.c index dfcfcd045..92eaa89a4 100644 --- a/builtin-verify-tag.c +++ b/builtin-verify-tag.c @@ -35,7 +35,7 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose) /* find the length without signature */ len = 0; - while (len < size && prefixcmp(buf + len, PGP_SIGNATURE "\n")) { + while (len < size && prefixcmp(buf + len, PGP_SIGNATURE)) { eol = memchr(buf + len, '\n', size - len); len += eol ? eol - (buf + len) + 1 : size - len; } @@ -45,14 +45,14 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose) memset(&gpg, 0, sizeof(gpg)); gpg.argv = args_gpg; gpg.in = -1; - gpg.out = 1; args_gpg[2] = path; - if (start_command(&gpg)) + if (start_command(&gpg)) { + unlink(path); return error("could not run gpg."); + } write_in_full(gpg.in, buf, len); close(gpg.in); - gpg.close_in = 0; ret = finish_command(&gpg); unlink(path); @@ -90,7 +90,7 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix) { int i = 1, verbose = 0, had_error = 0; - git_config(git_default_config); + git_config(git_default_config, NULL); if (argc == 1) usage(builtin_verify_tag_usage);