diff genshi/path.py @ 384:5b6e4335ee21 trunk

Fix for infinite loop in XPath test. Closes #82.
author cmlenz
date Mon, 04 Dec 2006 19:00:46 +0000
parents 7dabedbb53fb
children c66370dfc41b
line wrap: on
line diff
--- a/genshi/path.py
+++ b/genshi/path.py
@@ -244,8 +244,8 @@
 
                     # We're done with this step if it's the last step or the
                     # axis isn't "self"
-                    if last_step or not (axis is SELF or
-                                         axis is DESCENDANT_OR_SELF):
+                    if not matched or last_step or not (
+                            axis is SELF or axis is DESCENDANT_OR_SELF):
                         break
 
                 if (retval or not matched) and kind is START and \
Copyright (C) 2012-2017 Edgewall Software