For bug #154921, prevent an IndexError when a + is in USE.
authorZac Medico <zmedico@gentoo.org>
Mon, 13 Nov 2006 00:50:54 +0000 (00:50 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 13 Nov 2006 00:50:54 +0000 (00:50 -0000)
svn path=/main/trunk/; revision=5021

pym/portage.py

index 2f146a0194b1c55e03949d6268be3447b6a98751..13646b2fb54a6982ef3b0d70788eb1f019e910dc 100644 (file)
@@ -1691,6 +1691,8 @@ class config:
                                                writemsg(red("USE flags should not start with a '+': %s\n" % x),
                                                        noiselevel=-1)
                                                x=x[1:]
+                                               if not x:
+                                                       continue
 
                                        if (x[0]=="-"):
                                                if (x[1:] in myflags):
@@ -1758,6 +1760,8 @@ class config:
                                        writemsg(colorize("BAD", "USE flags should not start " + \
                                                "with a '+': %s\n" % x), noiselevel=-1)
                                        x = x[1:]
+                                       if not x:
+                                               continue
 
                                if x[0] == "-":
                                        try: