diff options
author | Guido van Rossum <guido@python.org> | 2007-10-22 00:09:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-10-22 00:09:51 (GMT) |
commit | 40d20bcf1fccfe8af2393f1aec88ba18e38d0bc1 (patch) | |
tree | 0d6616333b9c3cb004b659751fe9baa4bac67ad2 /Objects/bytesobject.c | |
parent | c2954e5273520031d3debfac8c668b9e611303b3 (diff) | |
download | cpython-40d20bcf1fccfe8af2393f1aec88ba18e38d0bc1.zip cpython-40d20bcf1fccfe8af2393f1aec88ba18e38d0bc1.tar.gz cpython-40d20bcf1fccfe8af2393f1aec88ba18e38d0bc1.tar.bz2 |
Issue 1267, continued.
Additional patch by Christian Heimes to deal more cleanly with the
FILE* vs file-descriptor issues.
I cleaned up his code a bit, and moved the lseek() call into import.c.
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r-- | Objects/bytesobject.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 18d0f57..db475cd 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -1214,7 +1214,7 @@ _bytes_tailmatch(PyBytesObject *self, PyObject *substr, Py_ssize_t start, Py_ssize_t len = PyBytes_GET_SIZE(self); const char* str; Py_buffer vsubstr; - int rv; + int rv = 0; str = PyBytes_AS_STRING(self); @@ -1226,13 +1226,11 @@ _bytes_tailmatch(PyBytesObject *self, PyObject *substr, Py_ssize_t start, if (direction < 0) { /* startswith */ if (start+vsubstr.len > len) { - rv = 0; goto done; } } else { /* endswith */ if (end-start < vsubstr.len || start > len) { - rv = 0; goto done; } |