Skip to content
Snippets Groups Projects
Commit f41539418b41 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

dirs.c: extract 'cpath' variable in _delpath() to match _addpath()

The PyString_AS_STRING() macro is probably free, but this makes
_delpath() more similar to _addpath() and simplifies the next patch.
parent b5052fc73300
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,7 @@
static int _delpath(PyObject *dirs, PyObject *path)
{
char *cpath = PyString_AS_STRING(path);
Py_ssize_t pos = PyString_GET_SIZE(path);
PyObject *key = NULL;
int ret = -1;
......@@ -102,7 +103,7 @@
while ((pos = _finddir(path, pos - 1)) != -1) {
PyObject *val;
key = PyString_FromStringAndSize(PyString_AS_STRING(path), pos);
key = PyString_FromStringAndSize(cpath, pos);
if (key == NULL)
goto bail;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment