From d138c4ab32e2b4a3c527ad12b4c10a3527472289 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 1 Jul 2009 15:29:06 +0000 Subject: Ensure that charset detection always returns CSS_OK unless there's a fatal error. Otherwise, it's possible to fail to process any of a short stylesheet (sheet.length < "@charset "). svn path=/trunk/libcss/; revision=8241 --- src/charset/detect.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/charset') diff --git a/src/charset/detect.c b/src/charset/detect.c index 2612fa8..9f8da69 100644 --- a/src/charset/detect.c +++ b/src/charset/detect.c @@ -144,10 +144,8 @@ parserutils_error css_charset_read_bom_or_charset(const uint8_t *data, } error = try_ascii_compatible_charset(data, len, &charset); - if (error != PARSERUTILS_OK) - return error; - - *mibenum = charset; + if (error == PARSERUTILS_OK) + *mibenum = charset; return PARSERUTILS_OK; } -- cgit v1.2.3