1
0
mirror of https://github.com/git/git.git synced 2024-09-28 00:29:55 +02:00

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;