The following commit has been merged in the master branch:
commit a9746761e3237e4cee5c5c7f5851b62b4de8ed37
Author: Guillem Jover <guil...@debian.org>
Date:   Sun Jul 11 19:00:56 2010 +0200

    u-a: Rename variable index to idx to not shadow index(3)

diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 5c0c939..04c333d 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -1409,7 +1409,7 @@ alternative_select_choice(struct alternative *a)
 {
        char *current, *ret, selection[_POSIX_PATH_MAX];
        struct fileset *best, *fs;
-       int len, index;
+       int len, idx;
 
        current = alternative_get_current(a);
        best = alternative_get_best(a);
@@ -1435,16 +1435,16 @@ alternative_select_choice(struct alternative *a)
                        mark = " ";
                pr("%s %-12d %-*s % -10d %s", mark, 0, len, best->master_file,
                   best->priority, _("auto mode"));
-               index = 1;
+               idx = 1;
                for (fs = a->choices; fs; fs = fs->next) {
                        if (a->status == ALT_ST_MANUAL && current &&
                            strcmp(current, fs->master_file) == 0)
                                mark = "*";
                        else
                                mark = " ";
-                       pr("%s %-12d %-*s % -10d %s", mark, index, len,
+                       pr("%s %-12d %-*s % -10d %s", mark, idx, len,
                           fs->master_file, fs->priority, _("manual mode"));
-                       index++;
+                       idx++;
                }
                printf("\n");
                printf(_("Press enter to keep the current choice[*], "
@@ -1457,16 +1457,16 @@ alternative_select_choice(struct alternative *a)
                selection[strlen(selection) - 1] = '\0';
                if (strlen(selection) == 0)
                        return current;
-               index = strtol(selection, &ret, 10);
+               idx = strtol(selection, &ret, 10);
                if (*ret == '\0') {
                        /* Look up by index */
-                       if (index == 0) {
+                       if (idx == 0) {
                                alternative_set_status(a, ALT_ST_AUTO);
                                free(current);
                                return xstrdup(best->master_file);
                        }
-                       index--;
-                       for (fs = a->choices; index && fs; index--)
+                       idx--;
+                       for (fs = a->choices; idx && fs; idx--)
                                fs = fs->next;
                        if (fs) {
                                alternative_set_status(a, ALT_ST_MANUAL);

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to