]> granicus.if.org Git - python/commitdiff
Fix a bug in translate(): the pointer was incremented by the length of
authorGuido van Rossum <guido@python.org>
Tue, 16 Dec 1997 21:12:47 +0000 (21:12 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 16 Dec 1997 21:12:47 +0000 (21:12 +0000)
the *escaped* url.  Also added new special characters that are not
part of the url when found at the end: ( < > .

Tools/faqwiz/faqwiz.py

index 9282b3614fd0f514355ff1e7363c6a8eb5d316df..14c4b304cd5c2dadad9d2fcbc1a24853c61fd3d0 100644 (file)
@@ -87,8 +87,9 @@ def translate(text, pre=0):
        list.append(escape(text[i:j]))
        i = j
        url = prog.group(0)
-       while url[-1] in ');:,.?\'"':
+       while url[-1] in '();:,.?\'"<>':
            url = url[:-1]
+       i = i + len(url)
        url = escape(url)
        if not pre or (pre and PROCESS_PREFORMAT):
            if ':' in url:
@@ -98,7 +99,6 @@ def translate(text, pre=0):
        else:
            repl = url
        list.append(repl)
-       i = i + len(url)
     j = len(text)
     list.append(escape(text[i:j]))
     return string.join(list, '')