mercurial/cext/manifest.c
branchstable
changeset 39939 e85462d48cb3
parent 39424 094d1f42c484
child 39940 5405cb1a7901
equal deleted inserted replaced
39809:23a00bc90a3c 39939:e85462d48cb3
    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 {