All pastes #32548 Raw Edit

Someone

public text v1 · immutable
#32548 ·published 2005-12-05 18:53 UTC
rendered paste body
[[[
Follow up to r43 with what is probably a correctness fix:

* update-threadfind.py
  (HTMLDecode): Adjust entityEnd in exception case.
]]]

Index: update-threadfind.py
===================================================================
--- update-threadfind.py        (revision 44)
+++ update-threadfind.py        (working copy)
@@ -101,7 +101,8 @@
                 entityCode = int(entity[2:-1])
               except:
                 end = re.search("[^0-9]", entity[2:-1])
-                entityCode = int(entity[2:2+end.start()])
+                entityEnd = end.start()
+                entityCode = int(entity[2:2+entityEnd])
             if entityCode > 255:
               entity = unichr(entityCode)
             else: