summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2006-10-12 03:12:16 +0000
committerRich Felker <dalias@aerifal.cx>2006-10-12 03:12:16 +0000
commit48820ddb03b5a9678b43d7c1a7d1596899bf3404 (patch)
tree916dceb9b5dc5152f4a3c8c35adaadf67364786c
parent78d6d73f6b0ab3566d33e44503efbde0ff841fad (diff)
better logic for attached rules
-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: