summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuve <veg@svgames.pl>2018-08-22 21:19:19 +0200
committerRichard Hughes <richard@hughsie.com>2018-08-27 13:45:03 +0100
commit0f2d0d19c2a8a36dd01d33cbe0a7c414c3209438 (patch)
tree69ececec55661afc73e629e1c273e869d7576ad7
parent38e9734d42ea9a7c6c69eb887fc4da0eb85c9faa (diff)
downloadappstream-glib-0f2d0d19c2a8a36dd01d33cbe0a7c414c3209438.tar.gz
Change order of arguments in matrix-html to match status-html
-rw-r--r--client/as-util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/client/as-util.c b/client/as-util.c
index 8c0bcde..c0122ff 100644
--- a/client/as-util.c
+++ b/client/as-util.c
@@ -2495,18 +2495,19 @@ as_util_matrix_html (AsUtilPrivate *priv, gchar **values, GError **error)
g_autoptr(GString) html = NULL;
/* check args */
- if (g_strv_length (values) < 2) {
+ guint value_count = g_strv_length (values);
+ if (value_count < 2) {
g_set_error_literal (error,
AS_ERROR,
AS_ERROR_INVALID_ARGUMENTS,
"Not enough arguments, "
- "expected matrix.html filename.xml.gz");
+ "expected filename.xml.gz matrix.html");
return FALSE;
}
/* load file */
store = as_store_new ();
- for (i = 1; values[i] != NULL; i++) {
+ for (i = 0; i < value_count - 1; i++) {
g_autoptr(GFile) file = NULL;
file = g_file_new_for_path (values[i]);
if (!as_store_from_file (store, file, NULL, NULL, error))
@@ -2567,7 +2568,7 @@ as_util_matrix_html (AsUtilPrivate *priv, gchar **values, GError **error)
g_string_append (html, "</html>\n");
/* save file */
- return g_file_set_contents (values[0], html->str, -1, error);
+ return g_file_set_contents (values[value_count - 1], html->str, -1, error);
}
static gboolean