give initialization a chance
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 13 Dec 1991 10:51:38 +0000 (02:51 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 13 Dec 1991 10:51:38 +0000 (02:51 -0800)
SCCS-vsn: usr.sbin/sendmail/src/udb.c 5.13

usr/src/usr.sbin/sendmail/src/udb.c

index cfbc8bb..f72d188 100644 (file)
@@ -8,9 +8,9 @@
 
 #ifndef lint
 #ifdef USERDB
 
 #ifndef lint
 #ifdef USERDB
-static char sccsid [] = "@(#)udb.c     5.12 (Berkeley) %G% (with USERDB)";
+static char sccsid [] = "@(#)udb.c     5.13 (Berkeley) %G% (with USERDB)";
 #else
 #else
-static char sccsid [] = "@(#)udb.c     5.12 (Berkeley) %G% (without USERDB)";
+static char sccsid [] = "@(#)udb.c     5.13 (Berkeley) %G% (without USERDB)";
 #endif
 #endif
 
 #endif
 #endif
 
@@ -118,8 +118,7 @@ udbexpand(a, sendq)
                printf("expand(%s)\n", a->q_paddr);
 
        /* make certain we are supposed to send to this address */
                printf("expand(%s)\n", a->q_paddr);
 
        /* make certain we are supposed to send to this address */
-       if (bitset(QDONTSEND, a->q_flags) ||
-           UdbSpec == NULL || UdbSpec[0] == '\0')
+       if (bitset(QDONTSEND, a->q_flags))
                return;
        CurEnv->e_to = a->q_paddr;
 
                return;
        CurEnv->e_to = a->q_paddr;
 
@@ -132,6 +131,10 @@ udbexpand(a, sendq)
                firstcall = FALSE;
        }
 
                firstcall = FALSE;
        }
 
+       /* short circuit the process if no chance of a match */
+       if (UdbSpec == NULL || UdbSpec[0] == '\0')
+               return;
+
        /* if name is too long, assume it won't match */
        if (strlen(a->q_user) > sizeof keybuf - 12)
                return;
        /* if name is too long, assume it won't match */
        if (strlen(a->q_user) > sizeof keybuf - 12)
                return;