Fix equery belongs to strip multiple slashes from path names. (Bug #234584)
authorfuzzyray <fuzzyray@gentoo.org>
Fri, 22 Aug 2008 20:14:08 +0000 (20:14 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Fri, 22 Aug 2008 20:14:08 +0000 (20:14 -0000)
svn path=/; revision=505

trunk/ChangeLog
trunk/src/equery/equery

index 4ec5c13084876726b344a4952041435071037ce8..17124b6a055947d41cfc25f6245bc66df9afb3f1 100644 (file)
@@ -1,3 +1,7 @@
+2008-08-22: Paul Varner <fuzzyray@gentoo.org>
+       * equery: Fix equery belongs to strip multiple slashes from path
+       names. (Bug #234584)
+
 2008-07-24: Paul Varner <fuzzyray@gentoo.org>
        * equery: Fix equery check to convert mtime to an integer so that
        comparisions always work. Thanks to Alexey Parshin for discovering the
index ed8c5c4d51b5f9b49bc8781d30ceb2de8a3117a1..63eb8b3e769f0603081913d5b996dbf999532da5 100755 (executable)
@@ -369,12 +369,13 @@ class CmdListBelongs(Command):
                if opts["fullRegex"]:
                        q = query
                else:
-                       # Trim trailing slash from query
+                       # Trim trailing and multiple slashes from query 
                        for i in range(0, len(query)):
-                               if (query[i][-1] == "/"):
-                                       query[i] = query[i][:-1]
+                               query[i] = re.compile('/+').sub('/', query[i])
+                               query[i] = query[i].rstrip('/')
                        q = map(lambda x: ((len(x) and x[0] == "/") and "^" or "/")
                                           + re.escape(x) + "$", query)
+                       print q
                try:
                        q = "|".join(q)
                        rx = re.compile(q)