app: Fix "multiple installations" prompt

When a remote is found in multiple installations and we ask "Which do
you want to use (0 to abort)?", the 0 choice isn't working because the
min value in the call to flatpak_number_prompt() was set to 1. Fix that
so the user can abort if they want.

Fixes https://github.com/flatpak/flatpak/issues/1305
This commit is contained in:
Matthew Leeds committed 2018-01-14 23:33:43 -08:00
1 parent b148160986
commit d9e4041eb1
1 file changed
+1 -1
+1 -1
View File
@@ -369,7 +369,7 @@ flatpak_resolve_duplicate_remotes (GPtrArray *dirs,
g_autofree char *dir_name = flatpak_dir_get_name (dir);
g_print("%d) %s\n", i + 1, dir_name);
}
chosen = flatpak_number_prompt (1, dirs_with_remote->len, _("Which do you want to use (0 to abort)?"));
chosen = flatpak_number_prompt (0, dirs_with_remote->len, _("Which do you want to use (0 to abort)?"));
if (chosen == 0)
return flatpak_fail (error, _("No remote chosen to resolve ‘%s’ which exists in multiple installations"), remote_name);
}