commit:     b979418e34137c8044614bcbf3a2b25f775f353e
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 16 06:10:34 2014 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 06:10:34 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=b979418e

qlist: fix processing of IUSE

Stripping out all + and - chars is wrong as it means we turn "static-libs"
into "static libs".  Make sure we nuke these only when they're the first
char in the flag.

---
 qlist.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qlist.c b/qlist.c
index 0ffa716..1373361 100644
--- a/qlist.c
+++ b/qlist.c
@@ -63,9 +63,11 @@ static char *grab_pkg_umap(q_vdb_pkg_ctx *pkg_ctx)
        umap[0] = '\0'; /* reset the buffer */
 
        makeargv(use, &use_argc, &use_argv);
+       /* strip out possible leading +/- flags in IUSE */
        for (i = 0; i < (int)strlen(iuse); i++)
                if (iuse[i] == '+' || iuse[i] == '-')
-                       iuse[i] = ' ';
+                       if (i == 0 || iuse[i - 1] == ' ')
+                               iuse[i] = ' ';
        makeargv(iuse, &iuse_argc, &iuse_argv);
        for (u = 1; u < use_argc; u++) {
                for (i = 1; i < iuse_argc; i++) {

Reply via email to