summaryrefslogtreecommitdiffstats
path: root/usr.sbin/named/db_lookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/named/db_lookup.c')
-rw-r--r--usr.sbin/named/db_lookup.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/named/db_lookup.c b/usr.sbin/named/db_lookup.c
index c1d047d..b425f2b 100644
--- a/usr.sbin/named/db_lookup.c
+++ b/usr.sbin/named/db_lookup.c
@@ -1,6 +1,6 @@
#if !defined(lint) && !defined(SABER)
static char sccsid[] = "@(#)db_lookup.c 4.18 (Berkeley) 3/21/91";
-static char rcsid[] = "$Id: db_lookup.c,v 1.2 1995/05/30 03:48:40 rgrimes Exp $";
+static char rcsid[] = "$Id: db_lookup.c,v 1.3 1995/08/20 21:18:24 peter Exp $";
#endif /* not lint */
/*
@@ -90,12 +90,13 @@ nlookup(name, htpp, fname, insert)
register unsigned hval;
register struct hashbuf *htp;
struct namebuf *parent = NULL;
+ int escaped = 0;
htp = *htpp;
hval = 0;
*fname = "???";
for (cp = name; c = *cp++; ) {
- if (c == '.') {
+ if (!escaped && (c == '.')) {
parent = np = nlookup(cp, htpp, fname, insert);
if (np == NULL)
return (NULL);
@@ -116,6 +117,10 @@ nlookup(name, htpp, fname, insert)
}
hval <<= HASHSHIFT;
hval += (isupper(c) ? tolower(c) : c) & HASHMASK;
+ if (escaped)
+ escaped = 0;
+ else if (c == '\\')
+ escaped = 1;
}
cp--;
/*
OpenPOWER on IntegriCloud