summaryrefslogtreecommitdiff
path: root/ucf.c
diff options
context:
space:
mode:
Diffstat (limited to 'ucf.c')
-rw-r--r--ucf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ucf.c b/ucf.c
index baf9c48..94caa40 100644
--- a/ucf.c
+++ b/ucf.c
@@ -90,9 +90,11 @@ int ucf_lookup(struct ucf *f, int idx, const unsigned *cc,
} else l = 1;
switch (x) {
case RULE_ATTACHED_TO:
+ if (i > idx) i = idx;
if (i && c[--i]-a < l) continue;
break;
case RULE_WITH_ATTACHED:
+ if (i < idx) i = idx;
if (c[++i]-a < l) continue;
break;
case RULE_FOLLOWS: