##// END OF EJS Templates
diffhelpers: handle CRLF in hunk last line without EOL...
Patrick Mezard -
r10129:900ccbd7 default
parent child Browse files
Show More
@@ -22,6 +22,9 b' static void _fix_newline(PyObject *hunk,'
22 PyObject *s = PyList_GET_ITEM(hunk, hunksz-1);
22 PyObject *s = PyList_GET_ITEM(hunk, hunksz-1);
23 char *l = PyString_AS_STRING(s);
23 char *l = PyString_AS_STRING(s);
24 int sz = PyString_GET_SIZE(s);
24 int sz = PyString_GET_SIZE(s);
25 if (sz > 1 && l[sz-2] == '\r')
26 /* tolerate CRLF in last line */
27 sz -= 1;
25 int alen = PyList_Size(a);
28 int alen = PyList_Size(a);
26 int blen = PyList_Size(b);
29 int blen = PyList_Size(b);
27 char c = l[0];
30 char c = l[0];
@@ -20,7 +20,7 b" w(' c\\r\\n')"
20 w(' d\n')
20 w(' d\n')
21 w('-e\n')
21 w('-e\n')
22 w('\ No newline at end of file\n')
22 w('\ No newline at end of file\n')
23 w('+z\n')
23 w('+z\r\n')
24 w('\ No newline at end of file\r\n')
24 w('\ No newline at end of file\r\n')
25 EOF
25 EOF
26
26
General Comments 0
You need to be logged in to leave comments. Login now