X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=apply.c;h=964df2db10c22d6ed0b89532e0af8cf9a43e607c;hb=44ec46a9dff34d0d0d207741094b3a8ebd0e5324;hp=e87190ea3868f1379d557226e4779c36546ffe3e;hpb=51017101c7a308745ba3c04944457f1dc6a55780;p=git.git diff --git a/apply.c b/apply.c index e87190ea3..964df2db1 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;