From: Linus Torvalds Date: Thu, 26 May 2005 20:28:42 +0000 (-0700) Subject: git-apply: when validating default names, check the final EOLN too X-Git-Tag: v0.99~448 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0e87e048e161c6636fe6c0136a30092165b728d1;p=git.git 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. --- diff --git a/apply.c b/apply.c index 3606419f9..2fab34754 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;