X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=read-cache.c;h=bfdaee02ab4f25d39620e8d398f90ce27ed03805;hb=000182eacf99cde27d5916aa415921924b82972c;hp=34c040ad6c3bd3d2f2f4228ec2aefb9945e0ff84;hpb=2cb45e95438c113871fbbea5b4f629f9463034e7;p=git.git diff --git a/read-cache.c b/read-cache.c index 34c040ad..bfdaee02 100644 --- a/read-cache.c +++ b/read-cache.c @@ -200,11 +200,13 @@ static int check_file_directory_conflict(const struct cache_entry *ce, cp = pathbuf; while (1) { char *ep = strchr(cp, '/'); + int len; if (!ep) break; *ep = 0; /* first cut it at slash */ + len = ep - pathbuf; pos = cache_name_pos(pathbuf, - htons(create_ce_flags(ep-cp, stage))); + htons(create_ce_flags(len, stage))); if (0 <= pos) { /* Our leading path component is registered as a file, * and we are trying to make it a directory. This is