summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-03-11 16:15:34 +0000
committerRichard Hughes <richard@hughsie.com>2015-03-11 16:17:22 +0000
commit17cfa1a322371f7fa52844239086e43759f9f496 (patch)
tree9490ed10aea43156fd7cb80d2983acc41cbdcbf7
parentd11346118936e2be92aa4df869d0bfc441f4874f (diff)
downloadappstream-glib-17cfa1a322371f7fa52844239086e43759f9f496.tar.gz
trivial: Make the UTF-8 test actually match the comment
-rw-r--r--libappstream-glib/as-inf.c2
-rw-r--r--libappstream-glib/as-self-test.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/libappstream-glib/as-inf.c b/libappstream-glib/as-inf.c
index d1b50ff..55dcf7a 100644
--- a/libappstream-glib/as-inf.c
+++ b/libappstream-glib/as-inf.c
@@ -460,7 +460,7 @@ as_inf_repair_utf8 (AsInfHelper *helper, gchar *line, GError **error)
/* Microsoft keeps using 0x99 as UTF-8 (R), and it's not valid */
for (i = 0; line[i] != '\0'; i++) {
val = (guint8) line[i];
- if (val == 0xAE || val == 0x99) {
+ if (val == 0x99) {
if (helper->flags & AS_INF_LOAD_FLAG_STRICT) {
g_set_error (error,
AS_INF_ERROR,
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index b81a84a..28c2073 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -3559,12 +3559,12 @@ as_test_inf_func (void)
g_free (tmp);
/* invalid UTF-8 */
- ret = as_inf_load_data (kf, "[Version]\nProvider = Hughski \xae\n",
+ ret = as_inf_load_data (kf, "[Version]\nProvider = Hughski \x99\n",
AS_INF_LOAD_FLAG_STRICT, &error);
g_assert_error (error, AS_INF_ERROR, AS_INF_ERROR_FAILED);
g_assert (!ret);
g_clear_error (&error);
- ret = as_inf_load_data (kf, "[Version]\nProvider = Hughski \xae\n",
+ ret = as_inf_load_data (kf, "[Version]\nProvider = Hughski \x99\n",
AS_INF_LOAD_FLAG_NONE, &error);
g_assert_no_error (error);
g_assert (ret);