Merge lp:~evfool/software-center/fix506419 into lp:software-center

Proposed by Robert Roth
Status: Merged
Merged at revision: 1791
Proposed branch: lp:~evfool/software-center/fix506419
Merge into: lp:software-center
Diff against target: 14 lines (+3/-1)
1 file modified
softwarecenter/db/database.py (+3/-1)
To merge this branch: bzr merge lp:~evfool/software-center/fix506419
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+62097@code.launchpad.net

Description of the change

Strip the search term from trailing and leading spaces to avoid having different results for search terms ending with or without whitespace characters. (bug #506419)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/db/database.py'
2--- softwarecenter/db/database.py 2011-05-23 13:40:52 +0000
3+++ softwarecenter/db/database.py 2011-05-24 09:32:31 +0000
4@@ -239,7 +239,9 @@
5 if search_term == '':
6 self._logger.debug("grey-list replaced all terms, restoring")
7 search_term = orig_search_term
8-
9+ # we have to strip the leading and trailing whitespaces to avoid having
10+ # different results for e.g. 'font ' and 'font' (LP: #506419)
11+ search_term = search_term.strip()
12 # get a pkg query
13 pkg_query = xapian.Query()
14 for term in search_term.split():