##// END OF EJS Templates
osutil: more cleanups...
Matt Mackall -
r5423:e5f238a8 default
parent child Browse files
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 for (i = 0; i < size; i++) {
221 for (i = 0; i < size; i++) {
220 PyObject *elt = PyList_GetItem(list, i);
222 PyObject *elt = PyList_GetItem(list, i);
221 char *name = PyString_AsString(PyTuple_GET_ITEM(elt, 0));
223 char *name = PyString_AsString(PyTuple_GET_ITEM(elt, 0));
@@ -228,8 +230,7 static PyObject *listdir(PyObject *self,
228 if (kind != -1 && !do_stat)
230 if (kind != -1 && !do_stat)
229 continue;
231 continue;
230
232
231 strncat(full_path + path_len + 1, name,
233 strncat(full_path + path_len + 1, name, PATH_MAX - path_len);
232 PATH_MAX - path_len);
233 full_path[PATH_MAX] = 0;
234 full_path[PATH_MAX] = 0;
234
235
235 if (do_stat) {
236 if (do_stat) {
@@ -292,7 +293,6 static PyObject *listdir(PyObject *self,
292 PyTuple_SET_ITEM(elt, 2, py_st);
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