commit - 5345b4c7e102ec42f81e1b9b229294a0774d9b40
commit + aea75d87862c3ab54d0b8c5e5e280e13efe8ec4a
blob - 8bec2bca2e235fe87cbfca896a76cb8a1e46e6dc
blob + 08e7b0ccff9dcc74255388ca93d624636feee5ab
--- lib/got_lib_pack.h
+++ lib/got_lib_pack.h
const struct got_error *got_packidx_open(struct got_packidx **,
int, const char *, int);
const struct got_error *got_packidx_close(struct got_packidx *);
-const struct got_error *got_packidx_get_packfile_path(char **, struct got_packidx *);
+const struct got_error *got_packidx_get_packfile_path(char **, const char *);
off_t got_packidx_get_object_offset(struct got_packidx *, int idx);
int got_packidx_get_object_idx(struct got_packidx *, struct got_object_id *);
const struct got_error *got_packidx_match_id_str_prefix(
blob - 5c5f3bb280d592509f3a929c1b15d6003d2faa97
blob + bd60cd8b6abcd2895c9cbddca8e0c99886f92531
--- lib/object.c
+++ lib/object.c
if (err)
return err;
- err = got_packidx_get_packfile_path(&path_packfile, packidx);
+ err = got_packidx_get_packfile_path(&path_packfile,
+ packidx->path_packidx);
if (err)
return err;
if (err == NULL) {
struct got_pack *pack = NULL;
- err = got_packidx_get_packfile_path(&path_packfile, packidx);
+ err = got_packidx_get_packfile_path(&path_packfile,
+ packidx->path_packidx);
if (err)
goto done;
if (err == NULL) {
struct got_pack *pack = NULL;
- err = got_packidx_get_packfile_path(&path_packfile, packidx);
+ err = got_packidx_get_packfile_path(&path_packfile,
+ packidx->path_packidx);
if (err)
return err;
if (err == NULL) {
struct got_pack *pack = NULL;
- err = got_packidx_get_packfile_path(&path_packfile, packidx);
+ err = got_packidx_get_packfile_path(&path_packfile,
+ packidx->path_packidx);
if (err)
return err;
if (err == NULL) {
struct got_pack *pack = NULL;
- err = got_packidx_get_packfile_path(&path_packfile, packidx);
+ err = got_packidx_get_packfile_path(&path_packfile,
+ packidx->path_packidx);
if (err)
goto done;
if (err == NULL) {
struct got_pack *pack = NULL;
- err = got_packidx_get_packfile_path(&path_packfile, packidx);
+ err = got_packidx_get_packfile_path(&path_packfile,
+ packidx->path_packidx);
if (err)
return err;
return NULL;
}
- err = got_packidx_get_packfile_path(&path_packfile, packidx);
+ err = got_packidx_get_packfile_path(&path_packfile,
+ packidx->path_packidx);
if (err)
return err;
blob - 5f8dfb856fa6b279f5a7d058b7334047642919af
blob + 9bb2b1a4ab231495841a9af5bbea8d25a8d485fa
--- lib/pack.c
+++ lib/pack.c
}
const struct got_error *
-got_packidx_get_packfile_path(char **path_packfile, struct got_packidx *packidx)
+got_packidx_get_packfile_path(char **path_packfile, const char *path_packidx)
{
size_t size;
/* Packfile path contains ".pack" instead of ".idx", so add one byte. */
- size = strlen(packidx->path_packidx) + 2;
+ size = strlen(path_packidx) + 2;
if (size < GOT_PACKFILE_NAMELEN + 1)
- return got_error_path(packidx->path_packidx, GOT_ERR_BAD_PATH);
+ return got_error_path(path_packidx, GOT_ERR_BAD_PATH);
*path_packfile = malloc(size);
if (*path_packfile == NULL)
return got_error_from_errno("malloc");
/* Copy up to and excluding ".idx". */
- if (strlcpy(*path_packfile, packidx->path_packidx,
+ if (strlcpy(*path_packfile, path_packidx,
size - strlen(GOT_PACKIDX_SUFFIX) - 1) >= size)
return got_error(GOT_ERR_NO_SPACE);
blob - 8277291379829ca0b50aa77c2ae029a90d258983
blob + 15c0782632559de89351d64aec03314766fc7a79
--- lib/repository.c
+++ lib/repository.c
goto done;
*total_packsize += sb.st_size;
- err = got_packidx_get_packfile_path(&path_packfile, packidx);
+ err = got_packidx_get_packfile_path(&path_packfile,
+ packidx->path_packidx);
if (err)
goto done;