From ed224e1d64d9cc321efb44c659bd7b697f655cdc Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Wed, 13 Feb 2008 15:26:09 +0000 Subject: [PATCH] empty line fixup. git-svn-id: file:///svn/unbound/trunk@952 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 1 + libunbound/libunbound.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index 794f1140b..85e043d4a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,7 @@ - 0.9 released. - 1.0 development. Printout ldns version on unbound -h. - start of perf tool. + - bugfix to read empty lines from /etc/hosts. 12 February 2008: Wouter - fixup problem with configure calling itself if ldns-src tarball diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index 2b694dac1..0e7d70256 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -878,6 +878,8 @@ ub_ctx_hosts(struct ub_ctx* ctx, char* fname) /* skip addr */ while(isxdigit(*parse) || *parse == '.' || *parse == ':') parse++; + if(*parse == '\n' || *parse == 0) + continue; if(*parse != ' ' && *parse != '\t') { /* must have whitespace after address */ fclose(in); -- 2.47.2