Commit 525320bd authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  nelts returned from a registry key may be zero... make it so.
  [We previously would return an array of one empty element.]

PR: 9410
Submitted by:	Vasiliy Gagin <vasiliy@gazooc.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95284 13f79535-47bb-0310-9956-ffa450edef68
parent 93238f10
Loading
Loading
Loading
Loading
+7 −12
Changes for server/mpm/winnt/registry.c: 7 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -266,28 +266,23 @@ apr_status_t ap_registry_get_array(apr_pool_t *p, const char *key, const char *n
			     pValue,        /* for value */
			     &nSize);	/* for size of "value" */

        nSize = 1;    /* Element Count */
        tmp = pValue;
        while (tmp[0] || tmp[1])
        {
            if (!tmp[0])
        nSize = 0;    /* Element Count */
        for (tmp = pValue; *tmp; ++tmp) {
            ++nSize;
            while (*tmp) {
                ++tmp;
            }
        }

        *parray = apr_array_make(p, nSize, sizeof(char *));
        tmp = pValue;
        for (tmp = pValue; *tmp; ++tmp) {
            newelem = (char **) apr_array_push(*parray);
            *newelem = tmp;
        while (tmp[0] || tmp[1])
        {
            if (!tmp[0]) {
                newelem = (char **) apr_array_push(*parray);
                *newelem = tmp + 1;
            }
            while (*tmp) {
                ++tmp;
            }
        }
    }    
    
    RegCloseKey(hKey);