summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-04-15 00:48:59 +0200
committerGuillem Jover <guillem@debian.org>2012-04-15 10:39:41 +0200
commit09575e301b6f9593b6fb5c41b9a3f8a59238eef6 (patch)
treed20ad1c990587836991e7347b8cd647fb55ffde5
parent16b6174995dadd3cb6f136603b8b2c4471b7e9c2 (diff)
downloaddpkg-09575e301b6f9593b6fb5c41b9a3f8a59238eef6.tar.gz
u-a: Use current_choice instead of retrieving it again
-rw-r--r--utils/update-alternatives.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index e91ffaabc..d064b6784 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -3,7 +3,7 @@
*
* Copyright © 1995 Ian Jackson <ian@davenant.greenend.org.uk>
* Copyright © 2000-2002 Wichert Akkerman <wakkerma@debian.org>
- * Copyright © 2006-2010 Guillem Jover <guillem@debian.org>
+ * Copyright © 2006-2012 Guillem Jover <guillem@debian.org>
* Copyright © 2008 Pierre Habouzit <madcoder@debian.org>
* Copyright © 2009-2010 Raphaël Hertzog <hertzog@debian.org>
*
@@ -2662,13 +2662,10 @@ main(int argc, char **argv)
alternative_display_user(a);
} else if (alternative_choices_count(a) == 1 &&
a->status == ALT_ST_AUTO &&
- alternative_has_current_link(a)) {
- char *cur = alternative_get_current(a);
-
+ current_choice != NULL) {
pr(_("There is only one alternative in link group %s: %s"),
- a->master_name, cur);
+ a->master_name, current_choice);
pr(_("Nothing to configure."));
- free(cur);
} else {
new_choice = alternative_select_choice(a);
}