The message "\ No newline at end of file" which sometimes is produced
by diff(1) is locale dependent. We can't assume more than that it
begins with "\ ".
Signed-off-by: Fredrik Kuivinen <[EMAIL PROTECTED]>
---
The previous patch wasn't doing the right thing. Hopefully I have
managed to get it right this time.
apply.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
b94e5e845c241fff14334001aa5d418d22cd115e
diff --git a/apply.c b/apply.c
--- a/apply.c
+++ b/apply.c
@@ -672,9 +672,13 @@ static int parse_fragment(char *line, un
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 < 2 || line[1] != ' ')
return -1;
break;
}
@@ -683,7 +687,7 @@ static int parse_fragment(char *line, un
* it in the above loop because we hit oldlines == newlines == 0
* before seeing it.
*/
- if (12 < size && !memcmp(line, "\\ No newline", 12))
+ if (2 < size && !memcmp(line, "\\ ", 2))
offset += linelen(line, size);
patch->lines_added += added;
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html