From b53dd5708a539355525e14354afd72d87c2fbd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 4 Dec 2013 20:17:49 +0100 Subject: [PATCH] Nongreedy matches for retrieve_string --- fdroidserver/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index b82f7742..8db69d57 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -470,14 +470,14 @@ class vcs_bzr(vcs): def retrieve_string(xml_dir, string): if string.startswith('@string/'): - string_search = re.compile(r'.*"'+string[8:]+'".*>([^<]+?)<.*').search + string_search = re.compile(r'.*"'+string[8:]+'".*?>([^<]+?)<.*').search for xmlfile in glob.glob(os.path.join(xml_dir, '*.xml')): for line in file(xmlfile): matches = string_search(line) if matches: return retrieve_string(xml_dir, matches.group(1)) elif string.startswith('&') and string.endswith(';'): - string_search = re.compile(r'.*').search + string_search = re.compile(r'.*').search for xmlfile in glob.glob(os.path.join(xml_dir, '*.xml')): for line in file(xmlfile): matches = string_search(line)