Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 18493 invoked from network); 24 Apr 2004 18:56:01 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Apr 2004 18:56:01 -0000 Received: (qmail 5957 invoked by uid 500); 24 Apr 2004 18:55:51 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 5920 invoked by uid 500); 24 Apr 2004 18:55:51 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 5904 invoked by uid 500); 24 Apr 2004 18:55:51 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 5900 invoked from network); 24 Apr 2004 18:55:50 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 24 Apr 2004 18:55:50 -0000 Received: (qmail 18478 invoked by uid 1569); 24 Apr 2004 18:56:00 -0000 Date: 24 Apr 2004 18:56:00 -0000 Message-ID: <20040424185600.18477.qmail@minotaur.apache.org> From: nd@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/support htpasswd.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N nd 2004/04/24 11:56:00 Modified: . CHANGES support htpasswd.c Log: no longer refuse to process files that contain empty lines Revision Changes Path 1.1470 +3 -0 httpd-2.0/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/httpd-2.0/CHANGES,v retrieving revision 1.1469 retrieving revision 1.1470 diff -u -u -r1.1469 -r1.1470 --- CHANGES 24 Apr 2004 11:53:37 -0000 1.1469 +++ CHANGES 24 Apr 2004 18:55:59 -0000 1.1470 @@ -2,6 +2,9 @@ [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] 1.76 +8 -3 httpd-2.0/support/htpasswd.c Index: htpasswd.c =================================================================== RCS file: /home/cvs/httpd-2.0/support/htpasswd.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -u -r1.75 -r1.76 --- htpasswd.c 13 Mar 2004 22:18:19 -0000 1.75 +++ htpasswd.c 24 Apr 2004 18:56:00 -0000 1.76 @@ -394,7 +394,7 @@ 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 @@ 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. */