equal
deleted
inserted
replaced
19 #include <Python.h> |
19 #include <Python.h> |
20 #include <assert.h> |
20 #include <assert.h> |
21 #include <ctype.h> |
21 #include <ctype.h> |
22 #include <stdlib.h> |
22 #include <stdlib.h> |
23 #include <string.h> |
23 #include <string.h> |
|
24 #include "pythoncapi_compat.h" |
24 |
25 |
25 #include "util.h" |
26 #include "util.h" |
26 |
27 |
27 /* state machine for the fast path */ |
28 /* state machine for the fast path */ |
28 enum path_state { |
29 enum path_state { |
676 memcopy(dest, &destlen, destsize, &src[lastdot], |
677 memcopy(dest, &destlen, destsize, &src[lastdot], |
677 len - lastdot - 1); |
678 len - lastdot - 1); |
678 } |
679 } |
679 |
680 |
680 assert(PyBytes_Check(ret)); |
681 assert(PyBytes_Check(ret)); |
681 Py_SIZE(ret) = destlen; |
682 Py_SET_SIZE(ret, destlen); |
682 |
683 |
683 return ret; |
684 return ret; |
684 } |
685 } |
685 |
686 |
686 /* |
687 /* |