mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00: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:
parent
5041aa7040
commit
0e87e048e1
2
apply.c
2
apply.c
|
@ -381,7 +381,7 @@ static char *git_header_name(char *line)
|
||||||
if (c == '/')
|
if (c == '/')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!memcmp(name, second, len)) {
|
if (second[len] == '\n' && !memcmp(name, second, len)) {
|
||||||
char *ret = xmalloc(len + 1);
|
char *ret = xmalloc(len + 1);
|
||||||
memcpy(ret, name, len);
|
memcpy(ret, name, len);
|
||||||
ret[len] = 0;
|
ret[len] = 0;
|
||||||
|
|
Loading…
Reference in a new issue