summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-26 13:28:42 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-26 13:28:42 -0700
commit0e87e048e161c6636fe6c0136a30092165b728d1 (patch)
treea6163d0a2ff244a241c6dbe14364011902018b4e /apply.c
parent5041aa70405d2359114b285e7c97b877aa0c079a (diff)
downloadgit-0e87e048e161c6636fe6c0136a30092165b728d1.tar.gz
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.
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apply.c b/apply.c
index 3606419f9e..2fab34754e 100644
--- a/apply.c
+++ b/apply.c
@@ -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;