From d5cf42fa75363bd2254582cc74e24c0ef33fabe1 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 21 Mar 2000 16:16:59 +0000 Subject: suffix test was reversed. svn path=/trunk/; revision=2832 --- checkalias.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/checkalias.c b/checkalias.c index a16e04ca..28d7861f 100644 --- a/checkalias.c +++ b/checkalias.c @@ -131,15 +131,15 @@ int is_host_alias(const char *name, struct query *ctl) char *ep; /* - * Test is <= here because str_in_list() should have caught the + * Test is >= here because str_in_list() should have caught the * equal-length case above. Doing it this way guarantees that * ep[-1] is a valid reference. */ - if (strlen(idl->id) <= namelen) + if (strlen(idl->id) >= namelen) continue; - ep = idl->id + (strlen(idl->id) - namelen); + ep = (char *)name + (namelen - strlen(idl->id)); /* a suffix led by . must match */ - if (ep[-1] == '.' && !strcmp(ep, name)) + if (ep[-1] == '.' && !strcmp(ep, idl->id)) return(TRUE); } -- cgit v1.2.3