+ if (ce->name[len]> '/')
+ break;
+ if (ce->name[len]< '/')
+ continue;
What about
if (ce->name[len] < '/') {
if (strchr(ce->name + len + 1, '/'))
break;
else
continue;
}
to just punt if we'd go into a directory? I'm not much worried about
accessing foo-0001, foo-0002, foo-0003 while looking for foo/a (that
would be O(number of files in a directory), which is bearable), but
risking to go down a huge subtree is not very nice.
Paolo
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html