From f89555064a810ad7fcb3cbe079639ac3f83ff07c Mon Sep 17 00:00:00 2001 From: Julian Mehne Date: Fri, 1 Dec 2017 15:22:01 +0100 Subject: Allow regex special characters in tagstrings. Fixes the following crashes: 1. tag completion with regex special chars :search tag:[ 2. Changing tag representation of an (existing) tag with regex special chars: [tags] [[my**tag]] normal = '','', 'white','light red', 'white','#d66' 3. Contact completion with regex special chars and no external command: To:**foo --- alot/addressbook/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'alot/addressbook') diff --git a/alot/addressbook/__init__.py b/alot/addressbook/__init__.py index 17800b33..28c4ecc7 100644 --- a/alot/addressbook/__init__.py +++ b/alot/addressbook/__init__.py @@ -34,7 +34,7 @@ class AddressBook(object): def lookup(self, query=''): """looks up all contacts where name or address match query""" res = [] - query = re.compile('.*%s.*' % query, self.reflags) + query = re.compile('.*%s.*' % re.escape(query), self.reflags) for name, email in self.get_contacts(): if query.match(name) or query.match(email): res.append((name, email)) -- cgit v1.2.3