git-apply: when validating default names, check the final EOLN too

This means that filenames are totally unambiguous even if they
have spaces or tabs in them.
This commit is contained in:
Linus Torvalds 2005-05-26 13:28:42 -07:00
parent 5041aa7040
commit 0e87e048e1

View file

@ -381,7 +381,7 @@ static char *git_header_name(char *line)
if (c == '/')
break;
}
if (!memcmp(name, second, len)) {
if (second[len] == '\n' && !memcmp(name, second, len)) {
char *ret = xmalloc(len + 1);
memcpy(ret, name, len);
ret[len] = 0;