Show More
@@ -215,7 +215,9 static PyObject *listdir(PyObject *self, | |||||
215 | dfd = dirfd(dir); |
|
215 | dfd = dirfd(dir); | |
216 | #endif |
|
216 | #endif | |
217 |
|
217 | |||
218 |
if (do_stat || !all_kinds) |
|
218 | if (!(do_stat || !all_kinds)) | |
|
219 | goto done; | |||
|
220 | ||||
219 |
|
|
221 | for (i = 0; i < size; i++) { | |
220 |
|
|
222 | PyObject *elt = PyList_GetItem(list, i); | |
221 |
|
|
223 | char *name = PyString_AsString(PyTuple_GET_ITEM(elt, 0)); | |
@@ -228,8 +230,7 static PyObject *listdir(PyObject *self, | |||||
228 |
|
|
230 | if (kind != -1 && !do_stat) | |
229 |
|
|
231 | continue; | |
230 |
|
232 | |||
231 |
|
|
233 | strncat(full_path + path_len + 1, name, PATH_MAX - path_len); | |
232 | PATH_MAX - path_len); |
|
|||
233 |
|
|
234 | full_path[PATH_MAX] = 0; | |
234 |
|
235 | |||
235 |
|
|
236 | if (do_stat) { | |
@@ -292,7 +293,6 static PyObject *listdir(PyObject *self, | |||||
292 |
|
|
293 | PyTuple_SET_ITEM(elt, 2, py_st); | |
293 |
|
|
294 | } | |
294 |
|
|
295 | } | |
295 | } |
|
|||
296 |
|
296 | |||
297 | goto done; |
|
297 | goto done; | |
298 |
|
298 |
General Comments 0
You need to be logged in to leave comments.
Login now