forked from AuroraMiddleware/gtk
css: Actually break at end of the string
Introduced in 65c4c1555d
.
Found by gnome-continuous running the testsuite.
Includes fixing a broken test in the testsuite.
This commit is contained in:
parent
9ae12b15e9
commit
b90802f7e4
@ -1025,13 +1025,13 @@ _gtk_css_print_string (GString *str,
|
|||||||
g_string_append_c (str, '"');
|
g_string_append_c (str, '"');
|
||||||
|
|
||||||
do {
|
do {
|
||||||
len = strcspn (string, "\"\n\r\f");
|
len = strcspn (string, "\\\"\n\r\f");
|
||||||
g_string_append_len (str, string, len);
|
g_string_append_len (str, string, len);
|
||||||
string += len;
|
string += len;
|
||||||
switch (*string)
|
switch (*string)
|
||||||
{
|
{
|
||||||
case '\0':
|
case '\0':
|
||||||
break;
|
goto out;
|
||||||
case '\n':
|
case '\n':
|
||||||
g_string_append (str, "\\A ");
|
g_string_append (str, "\\A ");
|
||||||
break;
|
break;
|
||||||
@ -1054,6 +1054,7 @@ _gtk_css_print_string (GString *str,
|
|||||||
string++;
|
string++;
|
||||||
} while (*string);
|
} while (*string);
|
||||||
|
|
||||||
|
out:
|
||||||
g_string_append_c (str, '"');
|
g_string_append_c (str, '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ gtk_css_value_ident_print (const GtkCssValue *value,
|
|||||||
switch (*string)
|
switch (*string)
|
||||||
{
|
{
|
||||||
case '\0':
|
case '\0':
|
||||||
break;
|
goto out;
|
||||||
case '\n':
|
case '\n':
|
||||||
g_string_append (str, "\\A ");
|
g_string_append (str, "\\A ");
|
||||||
break;
|
break;
|
||||||
@ -113,6 +113,9 @@ gtk_css_value_ident_print (const GtkCssValue *value,
|
|||||||
}
|
}
|
||||||
string++;
|
string++;
|
||||||
} while (*string);
|
} while (*string);
|
||||||
|
|
||||||
|
out:
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GtkCssValueClass GTK_CSS_VALUE_STRING = {
|
static const GtkCssValueClass GTK_CSS_VALUE_STRING = {
|
||||||
|
@ -334,6 +334,7 @@ test_data = \
|
|||||||
single-slash.errors\
|
single-slash.errors\
|
||||||
single-slash.ref.css \
|
single-slash.ref.css \
|
||||||
string-values.css \
|
string-values.css \
|
||||||
|
string-values.ref.css \
|
||||||
test.png \
|
test.png \
|
||||||
transition.css \
|
transition.css \
|
||||||
transition.ref.css \
|
transition.ref.css \
|
||||||
|
27
testsuite/css/parser/string-values.ref.css
Normal file
27
testsuite/css/parser/string-values.ref.css
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
n {
|
||||||
|
font-family: "\A ";
|
||||||
|
}
|
||||||
|
|
||||||
|
r {
|
||||||
|
font-family: "\C ";
|
||||||
|
}
|
||||||
|
|
||||||
|
f {
|
||||||
|
font-family: "\D ";
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
font-family: "\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
b {
|
||||||
|
font-family: "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
c {
|
||||||
|
font-family: "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
d {
|
||||||
|
font-family: "\\";
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user