*** chives/resolv.c Tue Oct 10 00:39:37 1989 --- resolv.c Tue Sep 10 17:26:52 1991 *************** *** 179,188 **** /* Do not optimize this out, it's for the memory alloc debugging code. */ static char *nullstring = ""; - /* Initialize first entry in local search path to the root */ - lsearch = (char **) mak(sizeof(char *)*2); - lsearch[0] = nullstring; lsearch[1] = NULL; - if((cf = fopen(cf_name,"r")) == NULL) { bugchk("config","couldn't open config file \"%s\"",cf_name); return(0); --- 179,184 ---- *************** *** 338,345 **** fclose(cf); /* Check that search paths at least contain the root entry */ ! if(lsearch == NULL) /* paranoia, but cheap */ lsearch = nullsearch; if(rsearch == NULL) /* might not be set at all */ rsearch = nullsearch; else { /* check for root entry */ --- 334,351 ---- fclose(cf); /* Check that search paths at least contain the root entry */ ! if(lsearch == NULL) /* might not be set at all */ lsearch = nullsearch; + else { /* check for root entry */ + for(i = 0; lsearch[i] != NULL; ++i) + if(*lsearch[i] == '\0') /* exit if we find the root */ + break; + if(lsearch[i] == NULL) { /* if we didn't find it, add it */ + lsearch = (char **)remak_(lsearch,(sizeof(char *)*(i+2))); + lsearch[i] = nullstring; /* last entry is root */ + lsearch[i+1] = NULL; /* tie off list */ + } + } if(rsearch == NULL) /* might not be set at all */ rsearch = nullsearch; else { /* check for root entry */