| 1 |
diff -up GConf-2.25.2/backends/markup-tree.c.less-work GConf-2.25.2/backends/markup-tree.c
|
| 2 |
--- GConf-2.25.2/backends/markup-tree.c.less-work 2009-02-16 19:15:19.000000000 -0500
|
| 3 |
+++ GConf-2.25.2/backends/markup-tree.c 2009-03-03 23:14:07.741320798 -0500
|
| 4 |
@@ -2167,51 +2167,40 @@ locate_attributes (GMarkupParseContext *
|
| 5 |
|
| 6 |
retval = TRUE;
|
| 7 |
|
| 8 |
- i = 0;
|
| 9 |
- while (attribute_names[i])
|
| 10 |
+ for (i = 0; attribute_names[i]; i++)
|
| 11 |
{
|
| 12 |
int j;
|
| 13 |
- gboolean found;
|
| 14 |
|
| 15 |
- found = FALSE;
|
| 16 |
- j = 0;
|
| 17 |
- while (j < n_attrs)
|
| 18 |
+ for (j = 0; j < n_attrs; j++)
|
| 19 |
{
|
| 20 |
+ /* already matched */
|
| 21 |
+ if (attrs[j].name == NULL)
|
| 22 |
+ continue;
|
| 23 |
+
|
| 24 |
if (strcmp (attrs[j].name, attribute_names[i]) == 0)
|
| 25 |
{
|
| 26 |
retloc = attrs[j].retloc;
|
| 27 |
+ attrs[j].name = NULL;
|
| 28 |
|
| 29 |
- if (*retloc != NULL)
|
| 30 |
- {
|
| 31 |
- set_error (error, context,
|
| 32 |
- GCONF_ERROR_PARSE_ERROR,
|
| 33 |
- _("Attribute \"%s\" repeated twice on the same <%s> element"),
|
| 34 |
- attrs[j].name, element_name);
|
| 35 |
- retval = FALSE;
|
| 36 |
- goto out;
|
| 37 |
- }
|
| 38 |
+ /* if this fails we passed the same retloc twice */
|
| 39 |
+ g_assert (*retloc == NULL);
|
| 40 |
|
| 41 |
*retloc = attribute_values[i];
|
| 42 |
- found = TRUE;
|
| 43 |
+ break;
|
| 44 |
}
|
| 45 |
-
|
| 46 |
- ++j;
|
| 47 |
}
|
| 48 |
|
| 49 |
- if (!found)
|
| 50 |
+ if (j >= n_attrs)
|
| 51 |
{
|
| 52 |
set_error (error, context,
|
| 53 |
GCONF_ERROR_PARSE_ERROR,
|
| 54 |
- _("Attribute \"%s\" is invalid on <%s> element in this context"),
|
| 55 |
+ _("Attribute \"%s\" is invalid, or duplicated on <%s> element in this context"),
|
| 56 |
attribute_names[i], element_name);
|
| 57 |
retval = FALSE;
|
| 58 |
- goto out;
|
| 59 |
+ break;
|
| 60 |
}
|
| 61 |
-
|
| 62 |
- ++i;
|
| 63 |
}
|
| 64 |
|
| 65 |
- out:
|
| 66 |
return retval;
|
| 67 |
}
|
| 68 |
|
| 69 |
@@ -3494,10 +3483,9 @@ all_whitespace (const char *text,
|
| 70 |
|
| 71 |
while (p != end)
|
| 72 |
{
|
| 73 |
- if (!g_ascii_isspace (*p))
|
| 74 |
- return FALSE;
|
| 75 |
-
|
| 76 |
- p = g_utf8_next_char (p);
|
| 77 |
+ if (G_UNLIKELY (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\r'))
|
| 78 |
+ return FALSE;
|
| 79 |
+ p++;
|
| 80 |
}
|
| 81 |
|
| 82 |
return TRUE;
|