projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Debian: build-depend on "bc"
[git.git]
/
apply.c
diff --git
a/apply.c
b/apply.c
index
3ebbf6b
..
964df2d
100644
(file)
--- 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;
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 '\\':
case '\\':
- if (len < 12 || memcmp(line, "\\
No newline", 1
2))
+ if (len < 12 || memcmp(line, "\\
",
2))
return -1;
break;
}
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.
*/
* it in the above loop because we hit oldlines == newlines == 0
* before seeing it.
*/
- if (12 < size && !memcmp(line, "\\
No newline", 1
2))
+ if (12 < size && !memcmp(line, "\\
",
2))
offset += linelen(line, size);
patch->lines_added += added;
offset += linelen(line, size);
patch->lines_added += added;
@@
-1377,7
+1381,7
@@
static struct excludes {
static int use_patch(struct patch *p)
{
static int use_patch(struct patch *p)
{
- const char *pathname = p->new_name ? : p->old_name;
+ const char *pathname = p->new_name ?
p->new_name
: p->old_name;
struct excludes *x = excludes;
while (x) {
if (fnmatch(x->path, pathname, 0) == 0)
struct excludes *x = excludes;
while (x) {
if (fnmatch(x->path, pathname, 0) == 0)