From: Ryan Bloom Date: Wed, 18 Oct 2000 15:58:29 +0000 (+0000) Subject: The final line of the config file was not being read if there was X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c119a370aa07507e9f66f92799afdabe78255f1;p=apache The final line of the config file was not being read if there was no \n at the end of it. This was caused by apr_fgets returning APR_EOF even though we had read valid data. This is solved by making cfg_getline check the buff that was returned from apr_fgets. If apr_fgets return APR_EOF, but there was data in the buf, then we return the buf, otherwise we return NULL. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86643 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util.c b/server/util.c index 115d8b2f27..6b23e71525 100644 --- a/server/util.c +++ b/server/util.c @@ -862,7 +862,9 @@ static int cfg_getch(void *param) static void *cfg_getstr(void *buf, size_t bufsiz, void *param) { apr_file_t *cfp = (apr_file_t *) param; - if (apr_fgets(buf, bufsiz, cfp) == APR_SUCCESS) + apr_status_t rv; + rv = apr_fgets(buf, bufsiz, cfp); + if (rv == APR_SUCCESS || (rv == APR_EOF && strcmp(buf, ""))) return buf; return NULL; }