From: André Malo Date: Sat, 24 Apr 2004 18:56:00 +0000 (+0000) Subject: no longer refuse to process files that contain empty lines X-Git-Tag: pre_ajp_proxy~321 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18f32ed6a960a3d798c334ddec614762591f571e;p=apache no longer refuse to process files that contain empty lines git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103507 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 05cdd4fa21..e6b094780d 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) htpasswd no longer refuses to process files that contain empty + lines. [André Malo] + *) Restore the ability to disable the use of AcceptEx on Win9x systems automatically. PR 28529. [André Malo] diff --git a/support/htpasswd.c b/support/htpasswd.c index 16d83d7b83..3675c52b46 100644 --- a/support/htpasswd.c +++ b/support/htpasswd.c @@ -394,7 +394,7 @@ int main(int argc, const char * const argv[]) char *user = NULL; char tn[] = "htpasswd.tmp.XXXXXX"; char *dirname; - char scratch[MAX_STRING_LEN]; + char *scratch, cp[MAX_STRING_LEN]; int found = 0; int i; int alg = ALG_CRYPT; @@ -533,11 +533,16 @@ int main(int argc, const char * const argv[]) while (apr_file_gets(line, sizeof(line), fpw) == APR_SUCCESS) { char *colon; - if ((line[0] == '#') || (line[0] == '\0')) { + strcpy(cp, line); + scratch = cp; + while (apr_isspace(*scratch)) { + ++scratch; + } + + if (!*scratch || (*scratch == '#')) { putline(ftemp, line); continue; } - strcpy(scratch, line); /* * See if this is our user. */