diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 1aef9117fd..462b551d41 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -1790,7 +1790,12 @@ parse_import (GtkCssScanner *scanner) return TRUE; } - if (gtk_css_scanner_would_recurse (scanner, file)) + if (!_gtk_css_parser_try (scanner->parser, ";", TRUE)) + { + gtk_css_provider_invalid_token (scanner->provider, scanner, "semicolon"); + _gtk_css_parser_resync (scanner->parser, TRUE, 0); + } + else if (gtk_css_scanner_would_recurse (scanner, file)) { char *path = g_file_get_path (file); gtk_css_provider_error (scanner->provider, @@ -1810,12 +1815,6 @@ parse_import (GtkCssScanner *scanner) NULL); } - if (!_gtk_css_parser_try (scanner->parser, ";", TRUE)) - { - gtk_css_provider_invalid_token (scanner->provider, scanner, "semicolon"); - _gtk_css_parser_resync (scanner->parser, TRUE, 0); - } - g_object_unref (file); gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_IMPORT);