summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-04 15:47:28 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-04 15:47:28 -0700
commitf5f2c52bb08a7fc5bde6a7eb6552235df9daca71 (patch)
tree8a3114a7c1ca47a98b03a01f688666a026a6948f /apply.c
parent8afaf4cbefc735d71d1417a74b9cc20b0e3c6770 (diff)
parent52be5fcd29e074cb549b9a92ff8caceb736e4851 (diff)
downloadgit-f5f2c52bb08a7fc5bde6a7eb6552235df9daca71.tar.gz
Merge branch 'master' of .
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apply.c b/apply.c
index e87190ea38..964df2db10 100644
--- a/apply.c
+++ b/apply.c
@@ -672,9 +672,13 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s
added++;
newlines--;
break;
- /* We allow "\ No newline at end of file" */
+
+ /* We allow "\ No newline at end of file". Depending
+ * on locale settings when the patch was produced we
+ * don't know what this line looks like. The only
+ * thing we do know is that it begins with "\ ". */
case '\\':
- if (len < 12 || memcmp(line, "\\ No newline", 12))
+ if (len < 12 || memcmp(line, "\\ ", 2))
return -1;
break;
}
@@ -683,7 +687,7 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s
* it in the above loop because we hit oldlines == newlines == 0
* before seeing it.
*/
- if (12 < size && !memcmp(line, "\\ No newline", 12))
+ if (12 < size && !memcmp(line, "\\ ", 2))
offset += linelen(line, size);
patch->lines_added += added;