From 48820ddb03b5a9678b43d7c1a7d1596899bf3404 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 12 Oct 2006 03:12:16 +0000 Subject: better logic for attached rules --- ucf.c | 2 ++ 1 file changed, 2 insertions(+) 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: -- cgit v1.2.3