##// END OF EJS Templates
diffhelpers: fix variable declaration for MSVC (not C99)
Patrick Mezard -
r10146:9c59cdaf default
parent child Browse files
Show More
@@ -21,15 +21,17 b' static void _fix_newline(PyObject *hunk,'
21 int hunksz = PyList_Size(hunk);
21 int hunksz = PyList_Size(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 alen = PyList_Size(a);
25 int blen = PyList_Size(b);
26 char c = l[0];
27 PyObject *hline;
24 int sz = PyString_GET_SIZE(s);
28 int sz = PyString_GET_SIZE(s);
29
25 if (sz > 1 && l[sz-2] == '\r')
30 if (sz > 1 && l[sz-2] == '\r')
26 /* tolerate CRLF in last line */
31 /* tolerate CRLF in last line */
27 sz -= 1;
32 sz -= 1;
28 int alen = PyList_Size(a);
33 hline = PyString_FromStringAndSize(l, sz-1);
29 int blen = PyList_Size(b);
30 char c = l[0];
31
34
32 PyObject *hline = PyString_FromStringAndSize(l, sz-1);
33 if (c == ' ' || c == '+') {
35 if (c == ' ' || c == '+') {
34 PyObject *rline = PyString_FromStringAndSize(l+1, sz-2);
36 PyObject *rline = PyString_FromStringAndSize(l+1, sz-2);
35 PyList_SetItem(b, blen-1, rline);
37 PyList_SetItem(b, blen-1, rline);
General Comments 0
You need to be logged in to leave comments. Login now