static char *traverse_path(const struct traverse_info *info, const struct name_entry *n)
{
- char *path = xmallocz(traverse_path_len(info, n));
+ char *path = xmallocz(traverse_path_len(info, tree_entry_len(n)));
return make_traverse_path(path, info, n->path, n->pathlen);
}
const char *name, size_t namelen);
void setup_traverse_info(struct traverse_info *info, const char *base);
-static inline size_t traverse_path_len(const struct traverse_info *info, const struct name_entry *n)
+static inline size_t traverse_path_len(const struct traverse_info *info,
+ size_t namelen)
{
- return st_add(info->pathlen, tree_entry_len(n));
+ return st_add(info->pathlen, namelen);
}
/* in general, positive means "kind of interesting" */
struct traverse_info *info)
{
struct unpack_trees_options *o = info->data;
- size_t len = traverse_path_len(info, names);
+ size_t len = traverse_path_len(info, tree_entry_len(names));
char *name = xmalloc(len + 1 /* slash */ + 1 /* NUL */);
int pos;
* Even if the beginning compared identically, the ce should
* compare as bigger than a directory leading up to it!
*/
- return ce_namelen(ce) > traverse_path_len(info, n);
+ return ce_namelen(ce) > traverse_path_len(info, tree_entry_len(n));
}
static int ce_in_traverse_path(const struct cache_entry *ce,
struct index_state *istate,
int is_transient)
{
- size_t len = traverse_path_len(info, n);
+ size_t len = traverse_path_len(info, tree_entry_len(n));
struct cache_entry *ce =
is_transient ?
make_empty_transient_cache_entry(len) :