The following commit has been merged in the master branch:
commit befa6d21586273f86e911b97aa1c80bde8380f3c
Author: Guillem Jover <[email protected]>
Date:   Sun Nov 7 09:11:52 2010 +0100

    u-a: Simplify an unify string in alternative_display_query()
    
    Unify the common string, and always call free() as it handles NULL just
    fine.

diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 1b7eb6a..ffa4a0a 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -1392,12 +1392,8 @@ alternative_display_query(struct alternative *a)
        if (best)
                pr("Best: %s", best->master_file);
        current = alternative_get_current(a);
-       if (current) {
-               pr("Value: %s", current);
-               free(current);
-       } else {
-               pr("Value: none");
-       }
+       pr("Value: %s", current ? current : "none");
+       free(current);
 
        for (fs = a->choices; fs; fs = fs->next) {
                printf("\n");

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to