summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-03-07 20:56:02 (GMT)
committerGeorg Brandl <georg@python.org>2006-03-07 20:56:02 (GMT)
commit516999e6e2b1d89bc29a8930d651e4cddf968bfe (patch)
tree91d18c0b35a9177d838fd15263578e21a924aa10 /Modules/posixmodule.c
parent437567ca7b5893f08d74241167bc9e30305c6511 (diff)
downloadcpython-516999e6e2b1d89bc29a8930d651e4cddf968bfe.zip
cpython-516999e6e2b1d89bc29a8930d651e4cddf968bfe.tar.gz
cpython-516999e6e2b1d89bc29a8930d651e4cddf968bfe.tar.bz2
Fix bug introduced in rev. 42884.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 3c28424..f982275 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1640,7 +1640,7 @@ posix_listdir(PyObject *self, PyObject *args)
PyObject *d, *v;
HANDLE hFindFile;
- BOOL result;
+ BOOL result = FALSE;
WIN32_FIND_DATA FileData;
/* MAX_PATH characters could mean a bigger encoded string */
char namebuf[MAX_PATH*2+5];
@@ -1679,7 +1679,7 @@ posix_listdir(PyObject *self, PyObject *args)
(wFileData.cFileName[1] == L'\0' ||
wFileData.cFileName[1] == L'.' &&
wFileData.cFileName[2] == L'\0'))
- continue;
+ goto loop_w;
v = PyUnicode_FromUnicode(wFileData.cFileName, wcslen(wFileData.cFileName));
if (v == NULL) {
Py_DECREF(d);
@@ -1693,6 +1693,7 @@ posix_listdir(PyObject *self, PyObject *args)
break;
}
Py_DECREF(v);
+loop_w:
Py_BEGIN_ALLOW_THREADS
result = FindNextFileW(hFindFile, &wFileData);
Py_END_ALLOW_THREADS
@@ -1736,7 +1737,7 @@ posix_listdir(PyObject *self, PyObject *args)
(FileData.cFileName[1] == '\0' ||
FileData.cFileName[1] == '.' &&
FileData.cFileName[2] == '\0'))
- continue;
+ goto loop_a;
v = PyString_FromString(FileData.cFileName);
if (v == NULL) {
Py_DECREF(d);
@@ -1750,6 +1751,7 @@ posix_listdir(PyObject *self, PyObject *args)
break;
}
Py_DECREF(v);
+loop_a:
Py_BEGIN_ALLOW_THREADS
result = FindNextFile(hFindFile, &FileData);
Py_END_ALLOW_THREADS