Skip to content

Commit

Permalink
git-apply: when validating default names, check the final EOLN too
Browse files Browse the repository at this point in the history
This means that filenames are totally unambiguous even if they
have spaces or tabs in them.
  • Loading branch information
Linus Torvalds committed May 26, 2005
1 parent 5041aa7 commit 0e87e04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0e87e04

Please sign in to comment.