mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Fix my_basename(): make the string ready
This commit is contained in:
parent
b619bb27ed
commit
31392e741d
1 changed files with 7 additions and 2 deletions
|
|
@ -963,8 +963,13 @@ static PyObject*
|
|||
my_basename(PyObject *name)
|
||||
{
|
||||
Py_ssize_t i, size, offset;
|
||||
int kind = PyUnicode_KIND(name);
|
||||
void *data = PyUnicode_DATA(name);
|
||||
int kind;
|
||||
void *data;
|
||||
|
||||
if (PyUnicode_READY(name))
|
||||
return NULL;
|
||||
kind = PyUnicode_KIND(name);
|
||||
data = PyUnicode_DATA(name);
|
||||
size = PyUnicode_GET_LENGTH(name);
|
||||
offset = 0;
|
||||
for(i=0; i < size; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue