PyObject* buf = tok->decoding_buffer;
if (buf == NULL) {
buf = PyObject_CallObject(tok->decoding_readline, NULL);
- if (buf == NULL) return error_ret(tok);
+ if (buf == NULL)
+ return error_ret(tok);
} else {
tok->decoding_buffer = NULL;
}
utf8 = PyUnicode_AsUTF8String(buf);
Py_DECREF(buf);
- if (utf8 == NULL) return error_ret(tok);
+ if (utf8 == NULL)
+ return error_ret(tok);
else {
const char* str = PyString_AsString(utf8);
assert(strlen(str) < (size_t)size); /* XXX */
PyObject *reader, *stream, *readline;
stream = PyFile_FromFile(tok->fp, tok->filename, "rb", NULL);
- if (stream == NULL) return 0;
+ if (stream == NULL)
+ return 0;
reader = PyCodec_StreamReader(enc, stream, NULL);
Py_DECREF(stream);
- if (reader == NULL) return 0;
+ if (reader == NULL)
+ return 0;
readline = PyObject_GetAttrString(reader, "readline");
Py_DECREF(reader);
- if (readline == NULL) return 0;
+ if (readline == NULL)
+ return 0;
tok->decoding_readline = readline;
return 1;
{
char *line;
int warn = 0, badchar = 0;
- for (;;)
+ for (;;) {
if (tok->decoding_state < 0) {
/* We already have a codec associated with
this input. */
return error_ret(tok);
assert(tok->decoding_state != 0);
}
+ }
if (line != NULL && tok->lineno < 2 && !tok->read_coding_spec) {
if (!check_coding_spec(line, strlen(line), tok, fp_setreadl)) {
return error_ret(tok);