From 0e87e048e161c6636fe6c0136a30092165b728d1 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 26 May 2005 13:28:42 -0700 Subject: [PATCH] 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. --- apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.26.2