vendor/libgit2/src/patch_parse.c in rugged-0.27.7 vs vendor/libgit2/src/patch_parse.c in rugged-0.27.9
- old
+ new
@@ -96,11 +96,11 @@
goto out;
patch->old_path = git_buf_detach(&old_path);
out:
- git_buf_dispose(&old_path);
+ git_buf_free(&old_path);
return error;
}
static int parse_header_git_newpath(
git_patch_parsed *patch, git_patch_parse_ctx *ctx)
@@ -112,11 +112,11 @@
goto out;
patch->new_path = git_buf_detach(&new_path);
out:
- git_buf_dispose(&new_path);
+ git_buf_free(&new_path);
return error;
}
static int parse_header_mode(uint16_t *mode, git_patch_parse_ctx *ctx)
{
@@ -456,30 +456,10 @@
done:
return error;
}
-static int parse_number(git_off_t *out, git_patch_parse_ctx *ctx)
-{
- const char *end;
- int64_t num;
-
- if (!git__isdigit(ctx->parse_ctx.line[0]))
- return -1;
-
- if (git__strntol64(&num, ctx->parse_ctx.line, ctx->parse_ctx.line_len, &end, 10) < 0)
- return -1;
-
- if (num < 0)
- return -1;
-
- *out = num;
- git_parse_advance_chars(&ctx->parse_ctx, (end - ctx->parse_ctx.line));
-
- return 0;
-}
-
static int parse_int(int *out, git_patch_parse_ctx *ctx)
{
git_off_t num;
if (git_parse_advance_digit(&num, &ctx->parse_ctx, 10) < 0 || !git__is_int(num))
@@ -775,11 +755,11 @@
binary->inflatedlen = (size_t)len;
binary->datalen = decoded.size;
binary->data = git_buf_detach(&decoded);
done:
- git_buf_dispose(&base85);
- git_buf_dispose(&decoded);
+ git_buf_free(&base85);
+ git_buf_free(&decoded);
return error;
}
static int parse_patch_binary(
git_patch_parsed *patch,