From: Justin Erenkrantz Date: Sat, 27 Dec 2003 07:12:41 +0000 (+0000) Subject: If we have a comment, place in a ':' not a ';' (has this *ever* worked?) X-Git-Tag: 2.0.49~270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cd8a253010d6508d664827d105051d5aef1a54b;p=thirdparty%2Fapache%2Fhttpd.git If we have a comment, place in a ':' not a ';' (has this *ever* worked?) If -n is specified and we have a comment, print the comment out too. Backup of support/htdbm.c r1.11 from httpd-2.1 Submitted by: Justin Erenkrantz Reviewed by: Justin Erenkrantz, Sander Striker, Jeff Trawick, Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102120 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 191bbc5ada6..5f61b94e808 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.49 + *) Fix htdbm to generate comment fields in DBM files correctly. + [Justin Erenkrantz] + *) mod_dav: Use bucket brigades when reading PUT data. This avoids problems if the data stream is modified by an input filter. PR 22104. [Tim Robbins , André Malo] diff --git a/support/htdbm.c b/support/htdbm.c index 26acb39d542..0b5431836cc 100644 --- a/support/htdbm.c +++ b/support/htdbm.c @@ -229,7 +229,7 @@ static apr_status_t htdbm_save(htdbm_t *htdbm, int *changed) if (!htdbm->comment) val.dptr = htdbm->userpass; else { - val.dptr = apr_pstrcat(htdbm->pool, htdbm->userpass, ";", + val.dptr = apr_pstrcat(htdbm->pool, htdbm->userpass, ":", htdbm->comment, NULL); val.dsize += (strlen(htdbm->comment) + 1); } @@ -602,8 +602,15 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "Database %s %s.\n", h->filename, h->create ? "created" : (changed ? "modified" : "updated")); } - if (cmd == HTDBM_NOFILE) - fprintf(stderr, "%s:%s\n", h->username, h->userpass); + if (cmd == HTDBM_NOFILE) { + if (!need_cmnt) { + fprintf(stderr, "%s:%s\n", h->username, h->userpass); + } + else { + fprintf(stderr, "%s:%s:%s\n", h->username, h->userpass, + h->comment); + } + } htdbm_terminate(h); apr_terminate();