~ubuntu-branches/debian/wheezy/dpkg/wheezy

« back to all changes in this revision

Viewing changes to utils/update-alternatives.c

  • Committer: Bazaar Package Importer
  • Author(s): Guillem Jover
  • Date: 2011-01-30 20:28:27 UTC
  • Revision ID: james.westby@ubuntu.com-20110130202827-o21lovzwwkldyx4y
Tags: 1.15.8.10
Do not segfault on “update-alternatives --auto” when the link group only
has alternatives which are dangling symlinks. Closes: #611545

Show diffs side-by-side

added added

removed removed

Lines of Context:
2323
2323
                alternative_set_status(a, ALT_ST_MANUAL);
2324
2324
        } else if (strcmp(action, "auto") == 0) {
2325
2325
                alternative_set_status(a, ALT_ST_AUTO);
2326
 
                new_choice = alternative_get_best(a)->master_file;
 
2326
                if (alternative_choices_count(a) == 0)
 
2327
                        pr(_("There is no program which provides %s."),
 
2328
                           a->master_name);
 
2329
                else
 
2330
                        new_choice = alternative_get_best(a)->master_file;
2327
2331
        } else if (strcmp(action, "config") == 0) {
2328
2332
                if (alternative_choices_count(a) == 0) {
2329
2333
                        pr(_("There is no program which provides %s."),