diff --git a/mercurial/dirs.c b/mercurial/dirs.c index f41539418b413b5aec512aa3fcf48996a39e81ac_bWVyY3VyaWFsL2RpcnMuYw==..fe3a72a3e7cab21ebb76d28419c38bed9158658c_bWVyY3VyaWFsL2RpcnMuYw== 100644 --- a/mercurial/dirs.c +++ b/mercurial/dirs.c @@ -28,5 +28,5 @@ PyObject *dict; } dirsObject; -static inline Py_ssize_t _finddir(PyObject *path, Py_ssize_t pos) +static inline Py_ssize_t _finddir(const char *path, Py_ssize_t pos) { @@ -32,4 +32,2 @@ { - const char *s = PyString_AS_STRING(path); - while (pos != -1) { @@ -35,5 +33,5 @@ while (pos != -1) { - if (s[pos] == '/') + if (path[pos] == '/') break; pos -= 1; } @@ -48,7 +46,7 @@ PyObject *key = NULL; int ret = -1; - while ((pos = _finddir(path, pos - 1)) != -1) { + while ((pos = _finddir(cpath, pos - 1)) != -1) { PyObject *val; /* It's likely that every prefix already has an entry @@ -100,7 +98,7 @@ PyObject *key = NULL; int ret = -1; - while ((pos = _finddir(path, pos - 1)) != -1) { + while ((pos = _finddir(cpath, pos - 1)) != -1) { PyObject *val; key = PyString_FromStringAndSize(cpath, pos);