Show More
@@ -118,7 +118,7 b' static PyObject *listdir(PyObject *self,' | |||||
118 | PyObject *list = NULL; |
|
118 | PyObject *list = NULL; | |
119 | PyObject *ctor_args = NULL; |
|
119 | PyObject *ctor_args = NULL; | |
120 | int all_kinds = 1; |
|
120 | int all_kinds = 1; | |
121 |
char |
|
121 | char full_path[PATH_MAX + 10]; | |
122 | int path_len; |
|
122 | int path_len; | |
123 | int do_stat; |
|
123 | int do_stat; | |
124 | char *path; |
|
124 | char *path; | |
@@ -143,8 +143,7 b' static PyObject *listdir(PyObject *self,' | |||||
143 | if (!list) |
|
143 | if (!list) | |
144 | goto bail; |
|
144 | goto bail; | |
145 |
|
145 | |||
146 |
full_path |
|
146 | strncpy(full_path, path, PATH_MAX); | |
147 | memcpy(full_path, path, path_len); |
|
|||
148 | full_path[path_len] = '/'; |
|
147 | full_path[path_len] = '/'; | |
149 |
|
148 | |||
150 | for (ent = readdir(dir); ent; ent = readdir(dir)) { |
|
149 | for (ent = readdir(dir); ent; ent = readdir(dir)) { | |
@@ -229,7 +228,9 b' static PyObject *listdir(PyObject *self,' | |||||
229 | if (kind != -1 && !do_stat) |
|
228 | if (kind != -1 && !do_stat) | |
230 | continue; |
|
229 | continue; | |
231 |
|
230 | |||
232 |
str |
|
231 | strncat(full_path + path_len + 1, name, | |
|
232 | PATH_MAX - path_len); | |||
|
233 | full_path[PATH_MAX] = 0; | |||
233 |
|
234 | |||
234 | if (do_stat) { |
|
235 | if (do_stat) { | |
235 | struct listdir_stat *st; |
|
236 | struct listdir_stat *st; |
General Comments 0
You need to be logged in to leave comments.
Login now