Remove "pathlen" from "struct name_entry"

Since we have the "tree_entry_len()" helper function these days, and
don't need to do a full strlen(), there's no point in saving the path
length - it's just redundant information.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Linus Torvalds
2007-03-21 10:07:46 -07:00
committed by Junio C Hamano
parent 171dccd511
commit a8c40471ab
6 changed files with 14 additions and 15 deletions

9
tree.c
View File

@ -101,14 +101,15 @@ int read_tree_recursive(struct tree *tree,
if (S_ISDIR(entry.mode)) {
int retval;
char *newbase;
unsigned int pathlen = tree_entry_len(entry.path, entry.sha1);
newbase = xmalloc(baselen + 1 + entry.pathlen);
newbase = xmalloc(baselen + 1 + pathlen);
memcpy(newbase, base, baselen);
memcpy(newbase + baselen, entry.path, entry.pathlen);
newbase[baselen + entry.pathlen] = '/';
memcpy(newbase + baselen, entry.path, pathlen);
newbase[baselen + pathlen] = '/';
retval = read_tree_recursive(lookup_tree(entry.sha1),
newbase,
baselen + entry.pathlen + 1,
baselen + pathlen + 1,
stage, match, fn);
free(newbase);
if (retval)