The following commit has been merged in the master branch:
commit 134791f7245e01f7d2d0a90bb8de2cda1097bdc6
Author: Guillem Jover <guil...@debian.org>
Date:   Mon Apr 16 03:58:15 2012 +0200

    u-a: Move alternative_parse_fileset() modified argument to struct 
altdb_context

diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index d9c781c..a03a380 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -1077,6 +1077,7 @@ alternative_remove_choice(struct alternative *a, const 
char *file)
 struct altdb_context {
        FILE *fh;
        char *filename;
+       bool modified;
        void DPKG_ATTR_PRINTF(2) (*bad_format)(struct altdb_context *,
                                               const char *format, ...);
        jmp_buf on_error;
@@ -1191,7 +1192,7 @@ alternative_parse_slave(struct alternative *a, struct 
altdb_context *ctx)
 
 static bool
 alternative_parse_fileset(struct alternative *a, struct altdb_context *ctx,
-                          bool *modified, bool must_not_die)
+                          bool must_not_die)
 {
        struct fileset *fs;
        struct slave_link *sl;
@@ -1229,7 +1230,7 @@ alternative_parse_fileset(struct alternative *a, struct 
altdb_context *ctx,
                        junk = altdb_get_line(ctx, _("slave file"));
                        free(junk);
                }
-               *modified = true;
+               ctx->modified = true;
        } else {
                char *endptr, *prio;
                long int iprio;
@@ -1256,7 +1257,6 @@ alternative_load(struct alternative *a, bool must_not_die)
        struct altdb_context ctx;
        struct stat st;
        char *fn, *status;
-       bool modified = false;
 
        /* Initialize parse context */
        if (setjmp(ctx.on_error)) {
@@ -1266,6 +1266,7 @@ alternative_load(struct alternative *a, bool must_not_die)
                alternative_reset(a);
                return false;
        }
+       ctx.modified = false;
        if (must_not_die)
                ctx.bad_format = altdb_parse_stop;
        else
@@ -1304,7 +1305,7 @@ alternative_load(struct alternative *a, bool must_not_die)
        while (alternative_parse_slave(a, &ctx));
 
        /* Parse the available choices in the alternative */
-       while (alternative_parse_fileset(a, &ctx, &modified, must_not_die));
+       while (alternative_parse_fileset(a, &ctx, must_not_die)) ;
 
        /* Close database file */
        if (fclose(ctx.fh))
@@ -1314,7 +1315,7 @@ alternative_load(struct alternative *a, bool must_not_die)
        /* Initialize the modified field which has been erroneously changed
         * by the various alternative_(add|set)_* calls:
         * false unless a choice has been auto-cleaned */
-       a->modified = modified;
+       a->modified = ctx.modified;
 
        return true;
 }

-- 
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