View | Details | Raw Unified
Collapse All | Expand All

(-) lib/lwres/lwconfig.c.old (-14 / +23 lines)
 Lines 175-187    Link Here 
	REQUIRE(buffer != NULL);
	REQUIRE(buffer != NULL);
	REQUIRE(size > 0U);
	REQUIRE(size > 0U);
	*p = '\0';
	ch = eatwhite(fp);
	ch = eatwhite(fp);
	if (ch == EOF)
		return (EOF);
	do {
	do {
		*p = '\0';
		*p = '\0';
 Lines 592-614    Link Here 
		if (strlen(word) == 0U)
		if (strlen(word) == 0U)
			rval = LWRES_R_SUCCESS;
			rval = LWRES_R_SUCCESS;
		else if (strcmp(word, "nameserver") == 0)
		else if (strcmp(word, "nameserver") == 0)
			rval = lwres_conf_parsenameserver(ctx, fp);
			rval = (stopchar != '\n')? /* fail instantly if EOL is reached */
				lwres_conf_parsenameserver(ctx, fp)
				: LWRES_R_FAILURE;
		else if (strcmp(word, "lwserver") == 0)
		else if (strcmp(word, "lwserver") == 0)
			rval = lwres_conf_parselwserver(ctx, fp);
			rval = (stopchar != '\n')?
				lwres_conf_parselwserver(ctx, fp)
				: LWRES_R_FAILURE;
		else if (strcmp(word, "domain") == 0)
		else if (strcmp(word, "domain") == 0)
			rval = lwres_conf_parsedomain(ctx, fp);
			rval = (stopchar != '\n')?
				lwres_conf_parsedomain(ctx, fp)
				: LWRES_R_FAILURE;
		else if (strcmp(word, "search") == 0)
		else if (strcmp(word, "search") == 0)
			rval = lwres_conf_parsesearch(ctx, fp);
			rval = (stopchar != '\n')?
				lwres_conf_parsesearch(ctx, fp)
				: LWRES_R_FAILURE;
		else if (strcmp(word, "sortlist") == 0)
		else if (strcmp(word, "sortlist") == 0)
			rval = lwres_conf_parsesortlist(ctx, fp);
			rval = (stopchar != '\n')?
				lwres_conf_parsesortlist(ctx, fp)
				: LWRES_R_FAILURE;
		else if (strcmp(word, "options") == 0)
		else if (strcmp(word, "options") == 0)
			rval = lwres_conf_parseoption(ctx, fp);
			rval = (stopchar != '\n')?
				lwres_conf_parseoption(ctx, fp)
				: LWRES_R_FAILURE;
		else {
		else {
			/* unrecognised word. Ignore entire line */
			/* unrecognised word. Ignore entire line */
			rval = LWRES_R_SUCCESS;
			rval = LWRES_R_SUCCESS;
			stopchar = eatline(fp);
			if (stopchar != '\n') { /* do not eat the next line */
			if (stopchar == EOF) {
				stopchar = eatline(fp);
				break;
				if (stopchar == EOF) {
					break;
				}
			}
			}
		}
		}
		if (ret == LWRES_R_SUCCESS && rval != LWRES_R_SUCCESS)
		if (ret == LWRES_R_SUCCESS && rval != LWRES_R_SUCCESS)