]> granicus.if.org Git - apache/commitdiff
If we have a comment, place in a ':' not a ';' (has this *ever* worked?)
authorJustin Erenkrantz <jerenkrantz@apache.org>
Tue, 2 Dec 2003 09:41:45 +0000 (09:41 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Tue, 2 Dec 2003 09:41:45 +0000 (09:41 +0000)
If -n is specified and we have a comment, print the comment out too.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101946 13f79535-47bb-0310-9956-ffa450edef68

support/htdbm.c

index 26acb39d542839ae728432c74606dafa9494314e..0b5431836cc17506e8cf4fe998c4a6d092ce21c4 100644 (file)
@@ -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();