equal
deleted
inserted
replaced
40 #define MANIFEST_MALFORMED -3 |
40 #define MANIFEST_MALFORMED -3 |
41 |
41 |
42 /* get the length of the path for a line */ |
42 /* get the length of the path for a line */ |
43 static size_t pathlen(line *l) |
43 static size_t pathlen(line *l) |
44 { |
44 { |
45 return strlen(l->start); |
45 const char *end = memchr(l->start, '\0', l->len); |
|
46 return (end) ? (size_t)(end - l->start) : l->len; |
46 } |
47 } |
47 |
48 |
48 /* get the node value of a single line */ |
49 /* get the node value of a single line */ |
49 static PyObject *nodeof(line *l) |
50 static PyObject *nodeof(line *l) |
50 { |
51 { |