af_gb_init:
   15|  1.28k|void af_gb_init() {
   16|  1.28k|  pointer_idx = 0;
   17|       |
   18|   129k|   for (int i = 0; i < GB_SIZE; i++) {
  ------------------
  |  |    8|   129k|#define GB_SIZE 100
  ------------------
  |  Branch (18:20): [True: 128k, False: 1.28k]
  ------------------
   19|   128k|     pointer_arr[i] = NULL;
   20|   128k|   }
   21|  1.28k|}
af_gb_cleanup:
   23|  1.28k|void af_gb_cleanup() {
   24|   129k|  for(int i = 0; i < GB_SIZE; i++) {
  ------------------
  |  |    8|   129k|#define GB_SIZE 100
  ------------------
  |  Branch (24:18): [True: 128k, False: 1.28k]
  ------------------
   25|   128k|    if (pointer_arr[i] != NULL) {
  ------------------
  |  Branch (25:9): [True: 4.61k, False: 123k]
  ------------------
   26|  4.61k|      free(pointer_arr[i]);
   27|  4.61k|    }
   28|   128k|  }
   29|  1.28k|}
af_get_null_terminated:
   31|  12.6k|char *af_get_null_terminated(const uint8_t **data, size_t *size) {
   32|  12.6k|#define STR_SIZE 75
   33|  12.6k|  if (*size < STR_SIZE || (int)*size < 0) {
  ------------------
  |  |   32|  25.3k|#define STR_SIZE 75
  ------------------
  |  Branch (33:7): [True: 8.06k, False: 4.61k]
  |  Branch (33:27): [True: 0, False: 4.61k]
  ------------------
   34|  8.06k|    return NULL;
   35|  8.06k|  }
   36|       |
   37|  4.61k|  char *new_s = malloc(STR_SIZE + 1);
  ------------------
  |  |   32|  4.61k|#define STR_SIZE 75
  ------------------
   38|  4.61k|  memcpy(new_s, *data, STR_SIZE);
  ------------------
  |  |   32|  4.61k|#define STR_SIZE 75
  ------------------
   39|  4.61k|  new_s[STR_SIZE] = '\0';
  ------------------
  |  |   32|  4.61k|#define STR_SIZE 75
  ------------------
   40|       |
   41|  4.61k|  *data = *data+STR_SIZE;
  ------------------
  |  |   32|  4.61k|#define STR_SIZE 75
  ------------------
   42|  4.61k|  *size -= STR_SIZE;
  ------------------
  |  |   32|  4.61k|#define STR_SIZE 75
  ------------------
   43|  4.61k|  return new_s;
   44|  12.6k|}
af_gb_get_null_terminated:
   62|  12.6k|char *af_gb_get_null_terminated(const uint8_t **data, size_t *size) {
   63|       |
   64|  12.6k|  char *nstr = af_get_null_terminated(data, size);
   65|  12.6k|  if (nstr == NULL) {
  ------------------
  |  Branch (65:7): [True: 8.06k, False: 4.61k]
  ------------------
   66|  8.06k|    return NULL;
   67|  8.06k|  }
   68|  4.61k|  pointer_arr[pointer_idx++] = (void*)nstr;
   69|  4.61k|  return nstr;
   70|  12.6k|}
af_get_short:
   88|  1.26k|short af_get_short(const uint8_t **data, size_t *size) {
   89|  1.26k|  if (*size <= 0) return 0;
  ------------------
  |  Branch (89:7): [True: 1.02k, False: 243]
  ------------------
   90|    243|  short c = (short)(*data)[0];
   91|    243|  *data += 1;
   92|    243|  *size-=1;
   93|    243|  return c;
   94|  1.26k|}

LLVMFuzzerTestOneInput:
   42|  1.28k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   43|       |  // Initialize fuzzing garbage collector. We use this to easily
   44|       |  // get data types seeded with random input from the fuzzer.
   45|  1.28k|  af_gb_init();
   46|       |
   47|  1.28k|  const uint8_t *data2 = data;
   48|  1.28k|  size_t size2 = size;
   49|       |
   50|  1.28k|  char *new_str = af_gb_get_null_terminated(&data2, &size2);
   51|  1.28k|  char *new_dst = af_gb_get_null_terminated(&data2, &size2);
   52|  1.28k|  if (new_str != NULL && new_dst != NULL) {
  ------------------
  |  Branch (52:7): [True: 1.26k, False: 15]
  |  Branch (52:26): [True: 1.26k, False: 3]
  ------------------
   53|  1.26k|    size_t new_str_len = strlen(new_str);
   54|       |
   55|       |    // Targets that do not require a pool
   56|       |
   57|  1.26k|    ap_cstr_casecmp(new_str, new_dst);
   58|  1.26k|    if (new_str_len > 2) {
  ------------------
  |  Branch (58:9): [True: 1.22k, False: 44]
  ------------------
   59|  1.22k|      ap_cstr_casecmpn(new_str, new_str + 2, new_str_len - 2);
   60|  1.22k|    }
   61|  1.26k|    ap_strcmp_match(new_str, new_dst);
   62|  1.26k|    ap_strcasecmp_match(new_str, new_dst);
   63|  1.26k|    ap_strcasestr(new_str, new_dst);
   64|       |
   65|  1.26k|    apr_interval_time_t timeout;
   66|  1.26k|    ap_timeout_parameter_parse(new_str, &timeout, "ms");
   67|       |
   68|  1.26k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   69|  1.26k|    if (new_dst != NULL) {
  ------------------
  |  Branch (69:9): [True: 397, False: 867]
  ------------------
   70|    397|      ap_getparents(new_dst);
   71|    397|    }
   72|       |
   73|  1.26k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   74|  1.26k|    if (new_dst != NULL) {
  ------------------
  |  Branch (74:9): [True: 320, False: 944]
  ------------------
   75|    320|      ap_no2slash(new_dst);
   76|    320|    }
   77|       |
   78|  1.26k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   79|  1.26k|    if (new_dst != NULL) {
  ------------------
  |  Branch (79:9): [True: 301, False: 963]
  ------------------
   80|    301|      ap_unescape_url(new_dst);
   81|    301|    }
   82|       |
   83|  1.26k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   84|  1.26k|    if (new_dst != NULL) {
  ------------------
  |  Branch (84:9): [True: 260, False: 1.00k]
  ------------------
   85|    260|      ap_unescape_urlencoded(new_dst);
   86|    260|    }
   87|       |
   88|  1.26k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   89|  1.26k|    if (new_dst != NULL) {
  ------------------
  |  Branch (89:9): [True: 224, False: 1.04k]
  ------------------
   90|    224|      ap_content_type_tolower(new_dst);
   91|    224|    }
   92|       |
   93|  1.26k|    new_dst = malloc(new_str_len*3+1); // big enough for worst-case URL-escaped (%nn)
   94|  1.26k|    ap_escape_path_segment_buffer(new_dst, new_str);
   95|  1.26k|    free(new_dst);
   96|       |
   97|  1.26k|    new_dst = malloc(new_str_len*4+1); // big enough for worst-case log-escaped (\xnn)
   98|  1.26k|    ap_escape_errorlog_item(new_dst, new_str, new_str_len*4+1);
   99|  1.26k|    free(new_dst);
  100|       |
  101|       |    // Pool initialisation
  102|  1.26k|    if (apr_pool_initialize() == APR_SUCCESS) {
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  |  Branch (102:9): [True: 1.26k, False: 0]
  ------------------
  103|  1.26k|      apr_pool_t *pool = NULL;
  104|  1.26k|      apr_pool_create(&pool, NULL);
  ------------------
  |  |  301|  1.26k|    apr_pool_create_ex(newpool, parent, NULL, NULL)
  ------------------
  105|       |
  106|       |      // Targets that require a pool
  107|       |
  108|  1.26k|      new_dst = af_gb_get_null_terminated(&data2, &size2);
  109|  1.26k|      if (new_dst != NULL) {
  ------------------
  |  Branch (109:11): [True: 208, False: 1.05k]
  ------------------
  110|    208|        ap_make_dirstr_parent(pool, new_dst);
  111|    208|      }
  112|       |
  113|  1.26k|      ap_field_noparam(pool, new_str);
  114|       |
  115|  1.26k|      ap_escape_shell_cmd(pool, new_str);
  116|  1.26k|      ap_os_escape_path(pool, new_str, 0);
  117|  1.26k|      ap_escape_html2(pool, new_str, 0);
  118|  1.26k|      ap_escape_logitem(pool, new_str);
  119|       |
  120|       |      // This line causes some issues if something bad is allocated
  121|  1.26k|      ap_escape_quotes(pool, new_str);
  122|       |
  123|       |      // base64
  124|  1.26k|      ap_pbase64decode(pool, new_str);
  125|  1.26k|      ap_pbase64encode(pool, new_str);
  126|  1.26k|      new_dst = af_gb_get_null_terminated(&data2, &size2);
  127|  1.26k|      if (new_dst != NULL) {
  ------------------
  |  Branch (127:11): [True: 202, False: 1.06k]
  ------------------
  128|    202|        char *d;
  129|    202|        apr_size_t dlen;
  130|    202|        ap_pbase64decode_strict(pool, new_dst, &d, &dlen);
  131|    202|      }
  132|       |
  133|       |      // List functions
  134|  1.26k|      const char *tmp_s = new_str;
  135|  1.26k|      ap_get_list_item(pool, &tmp_s);
  136|  1.26k|      ap_find_list_item(pool, new_str, "kjahsdfkj");
  137|  1.26k|      ap_find_token(pool, new_str, "klsjdfk");
  138|  1.26k|      ap_find_last_token(pool, new_str, "sdadf");
  139|  1.26k|      apr_array_header_t *offers = NULL;
  140|  1.26k|      ap_parse_token_list_strict(pool, new_str, &offers, 0);
  141|       |
  142|  1.26k|      tmp_s = new_str;
  143|  1.26k|      ap_get_token(pool, &tmp_s, 1);
  144|       |
  145|  1.26k|      tmp_s = NULL;
  146|  1.26k|      ap_pstr2_alnum(pool, new_str, &tmp_s);
  147|       |
  148|  1.26k|      ap_is_chunked(pool, new_str);
  149|       |
  150|       |      // Word functions
  151|  1.26k|      tmp_s = new_str;
  152|  1.26k|      ap_getword(pool, &tmp_s, 0);
  153|  1.26k|      tmp_s = new_str;
  154|  1.26k|      ap_getword_conf2(pool, &tmp_s);
  155|  1.26k|      new_dst = af_gb_get_null_terminated(&data2, &size2);
  156|  1.26k|      if (new_dst != NULL) {
  ------------------
  |  Branch (156:11): [True: 167, False: 1.09k]
  ------------------
  157|    167|        char *d = new_dst;
  158|    167|        ap_getword_white_nc(pool, &d);
  159|    167|      }
  160|       |
  161|  1.26k|      ap_escape_urlencoded(pool, new_str);
  162|       |
  163|       |
  164|  1.26k|			char filename[256];
  165|  1.26k|			sprintf(filename, "/tmp/libfuzzer.%d", getpid());
  166|  1.26k|			FILE *fp = fopen(filename, "wb");
  167|  1.26k|			fwrite(data, size, 1, fp);
  168|  1.26k|			fclose(fp);
  169|       |
  170|       |			// Fuzzer logic here
  171|  1.26k|			ap_configfile_t *cfg;
  172|  1.26k|			ap_pcfg_openfile(&cfg, pool, filename);
  173|  1.26k|      char tmp_line[100];
  174|  1.26k|      if ((af_get_short(&data2, &size2) % 2) == 0) {
  ------------------
  |  Branch (174:11): [True: 1.16k, False: 104]
  ------------------
  175|  1.16k|        ap_cfg_getline(tmp_line, 100, cfg);
  176|  1.16k|      }
  177|    104|      else {
  178|    104|        cfg->getstr = NULL;
  179|    104|        ap_cfg_getline(tmp_line, 100, cfg);
  180|    104|      }
  181|       |			// Fuzzer logic end
  182|       |
  183|  1.26k|			unlink(filename);
  184|       |
  185|       |      // Cleanup
  186|  1.26k|      apr_pool_terminate();
  187|  1.26k|    }
  188|  1.26k|  }
  189|       |
  190|       |  // Cleanup all of the memory allocated by the fuzz headers.
  191|  1.28k|  af_gb_cleanup();
  192|  1.28k|  return 0;
  193|  1.28k|}

ap_field_noparam:
  105|  1.26k|{
  106|  1.26k|    const char *semi;
  107|       |
  108|  1.26k|    if (intype == NULL) return NULL;
  ------------------
  |  Branch (108:9): [True: 0, False: 1.26k]
  ------------------
  109|       |
  110|  1.26k|    semi = ap_strchr_c(intype, ';');
  ------------------
  |  | 2504|  1.26k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
  111|  1.26k|    if (semi == NULL) {
  ------------------
  |  Branch (111:9): [True: 1.17k, False: 90]
  ------------------
  112|  1.17k|        return apr_pstrdup(p, intype);
  113|  1.17k|    }
  114|     90|    else {
  115|    305|        while ((semi > intype) && apr_isspace(semi[-1])) {
  ------------------
  |  |  225|    303|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 215, False: 88]
  |  |  ------------------
  ------------------
  |  Branch (115:16): [True: 303, False: 2]
  ------------------
  116|    215|            semi--;
  117|    215|        }
  118|     90|        return apr_pstrmemdup(p, intype, semi - intype);
  119|     90|    }
  120|  1.26k|}
ap_strcmp_match:
  189|  5.03k|{
  190|  5.03k|    apr_size_t x, y;
  191|       |
  192|  8.43k|    for (x = 0, y = 0; expected[y]; ++y, ++x) {
  ------------------
  |  Branch (192:24): [True: 7.97k, False: 463]
  ------------------
  193|  7.97k|        if (expected[y] == '*') {
  ------------------
  |  Branch (193:13): [True: 581, False: 7.39k]
  ------------------
  194|    811|            while (expected[++y] == '*');
  ------------------
  |  Branch (194:20): [True: 230, False: 581]
  ------------------
  195|    581|            if (!expected[y])
  ------------------
  |  Branch (195:17): [True: 5, False: 576]
  ------------------
  196|      5|                return 0;
  197|  3.82k|            while (str[x]) {
  ------------------
  |  Branch (197:20): [True: 3.76k, False: 56]
  ------------------
  198|  3.76k|                int ret;
  199|  3.76k|                if ((ret = ap_strcmp_match(&str[x++], &expected[y])) != 1)
  ------------------
  |  Branch (199:21): [True: 520, False: 3.24k]
  ------------------
  200|    520|                    return ret;
  201|  3.76k|            }
  202|     56|            return -1;
  203|    576|        }
  204|  7.39k|        else if (!str[x])
  ------------------
  |  Branch (204:18): [True: 24, False: 7.36k]
  ------------------
  205|     24|            return -1;
  206|  7.36k|        else if ((expected[y] != '?') && (str[x] != expected[y]))
  ------------------
  |  Branch (206:18): [True: 5.51k, False: 1.85k]
  |  Branch (206:42): [True: 3.96k, False: 1.54k]
  ------------------
  207|  3.96k|            return 1;
  208|  7.97k|    }
  209|    463|    return (str[x] != '\0');
  210|  5.03k|}
ap_strcasecmp_match:
  213|  5.03k|{
  214|  5.03k|    apr_size_t x, y;
  215|       |
  216|  8.43k|    for (x = 0, y = 0; expected[y]; ++y, ++x) {
  ------------------
  |  Branch (216:24): [True: 7.97k, False: 463]
  ------------------
  217|  7.97k|        if (!str[x] && expected[y] != '*')
  ------------------
  |  Branch (217:13): [True: 26, False: 7.94k]
  |  Branch (217:24): [True: 24, False: 2]
  ------------------
  218|     24|            return -1;
  219|  7.95k|        if (expected[y] == '*') {
  ------------------
  |  Branch (219:13): [True: 581, False: 7.36k]
  ------------------
  220|    811|            while (expected[++y] == '*');
  ------------------
  |  Branch (220:20): [True: 230, False: 581]
  ------------------
  221|    581|            if (!expected[y])
  ------------------
  |  Branch (221:17): [True: 5, False: 576]
  ------------------
  222|      5|                return 0;
  223|  3.82k|            while (str[x]) {
  ------------------
  |  Branch (223:20): [True: 3.76k, False: 56]
  ------------------
  224|  3.76k|                int ret;
  225|  3.76k|                if ((ret = ap_strcasecmp_match(&str[x++], &expected[y])) != 1)
  ------------------
  |  Branch (225:21): [True: 520, False: 3.24k]
  ------------------
  226|    520|                    return ret;
  227|  3.76k|            }
  228|     56|            return -1;
  229|    576|        }
  230|  7.36k|        else if (expected[y] != '?'
  ------------------
  |  Branch (230:18): [True: 5.51k, False: 1.85k]
  ------------------
  231|  7.36k|                 && apr_tolower(str[x]) != apr_tolower(expected[y]))
  ------------------
  |  |  231|  5.51k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                               && apr_tolower(str[x]) != apr_tolower(expected[y]))
  ------------------
  |  |  231|  5.51k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (231:21): [True: 3.96k, False: 1.54k]
  ------------------
  232|  3.96k|            return 1;
  233|  7.95k|    }
  234|    463|    return (str[x] != '\0');
  235|  5.03k|}
ap_strcasestr:
  303|  1.26k|{
  304|  1.26k|    char *p1, *p2;
  305|  1.26k|    if (*s2 == '\0') {
  ------------------
  |  Branch (305:9): [True: 179, False: 1.08k]
  ------------------
  306|       |        /* an empty s2 */
  307|    179|        return((char *)s1);
  308|    179|    }
  309|  10.7k|    while(1) {
  ------------------
  |  Branch (309:11): [Folded - Ignored]
  ------------------
  310|  48.8k|        for ( ; (*s1 != '\0') && (apr_tolower(*s1) != apr_tolower(*s2)); s1++);
  ------------------
  |  |  231|  47.8k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                      for ( ; (*s1 != '\0') && (apr_tolower(*s1) != apr_tolower(*s2)); s1++);
  ------------------
  |  |  231|  47.8k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (310:17): [True: 47.8k, False: 1.03k]
  |  Branch (310:34): [True: 38.1k, False: 9.69k]
  ------------------
  311|  10.7k|        if (*s1 == '\0') {
  ------------------
  |  Branch (311:13): [True: 1.03k, False: 9.69k]
  ------------------
  312|  1.03k|            return(NULL);
  313|  1.03k|        }
  314|       |        /* found first character of s2, see if the rest matches */
  315|  9.69k|        p1 = (char *)s1;
  316|  9.69k|        p2 = (char *)s2;
  317|  60.9k|        for (++p1, ++p2; apr_tolower(*p1) == apr_tolower(*p2); ++p1, ++p2) {
  ------------------
  |  |  231|  60.9k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                      for (++p1, ++p2; apr_tolower(*p1) == apr_tolower(*p2); ++p1, ++p2) {
  ------------------
  |  |  231|  60.9k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (317:26): [True: 51.3k, False: 9.68k]
  ------------------
  318|  51.3k|            if (*p1 == '\0') {
  ------------------
  |  Branch (318:17): [True: 13, False: 51.2k]
  ------------------
  319|       |                /* both strings ended together */
  320|     13|                return((char *)s1);
  321|     13|            }
  322|  51.3k|        }
  323|  9.68k|        if (*p2 == '\0') {
  ------------------
  |  Branch (323:13): [True: 33, False: 9.64k]
  ------------------
  324|       |            /* second string ended, a match */
  325|     33|            break;
  326|     33|        }
  327|       |        /* didn't find a match here, try starting at next character in s1 */
  328|  9.64k|        s1++;
  329|  9.64k|    }
  330|     33|    return((char *)s1);
  331|  1.08k|}
ap_normalize_path:
  503|    397|{
  504|    397|    int ret = 1;
  505|    397|    apr_size_t l = 1, w = 1, n;
  506|    397|    int decode_unreserved = (flags & AP_NORMALIZE_DECODE_UNRESERVED) != 0;
  ------------------
  |  | 1853|    397|#define AP_NORMALIZE_DECODE_UNRESERVED  (1u <<  2)
  ------------------
  507|    397|    int merge_slashes = (flags & AP_NORMALIZE_MERGE_SLASHES) != 0;
  ------------------
  |  | 1854|    397|#define AP_NORMALIZE_MERGE_SLASHES      (1u <<  3)
  ------------------
  508|       |
  509|    397|    if (!IS_SLASH(path[0])) {
  ------------------
  |  |   87|    397|#define IS_SLASH(s) (s == '/')
  ------------------
  |  Branch (509:9): [True: 382, False: 15]
  ------------------
  510|       |        /* Besides "OPTIONS *", a request-target should start with '/'
  511|       |         * per RFC 7230 section 5.3, so anything else is invalid.
  512|       |         */
  513|    382|        if (path[0] == '*' && path[1] == '\0') {
  ------------------
  |  Branch (513:13): [True: 19, False: 363]
  |  Branch (513:31): [True: 1, False: 18]
  ------------------
  514|      1|            return 1;
  515|      1|        }
  516|       |        /* However, AP_NORMALIZE_ALLOW_RELATIVE can be used to bypass
  517|       |         * this restriction (e.g. for subrequest file lookups).
  518|       |         */
  519|    381|        if (!(flags & AP_NORMALIZE_ALLOW_RELATIVE) || path[0] == '\0') {
  ------------------
  |  | 1851|    381|#define AP_NORMALIZE_ALLOW_RELATIVE     (1u <<  0)
  ------------------
  |  Branch (519:13): [True: 0, False: 381]
  |  Branch (519:55): [True: 46, False: 335]
  ------------------
  520|     46|            return 0;
  521|     46|        }
  522|       |
  523|    335|        l = w = 0;
  524|    335|    }
  525|       |
  526|  15.2k|    while (path[l] != '\0') {
  ------------------
  |  Branch (526:12): [True: 14.9k, False: 350]
  ------------------
  527|       |        /* RFC-3986 section 2.3:
  528|       |         *  For consistency, percent-encoded octets in the ranges of
  529|       |         *  ALPHA (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D),
  530|       |         *  period (%2E), underscore (%5F), or tilde (%7E) should [...]
  531|       |         *  be decoded to their corresponding unreserved characters by
  532|       |         *  URI normalizers.
  533|       |         */
  534|  14.9k|        if (decode_unreserved && path[l] == '%') {
  ------------------
  |  Branch (534:13): [True: 0, False: 14.9k]
  |  Branch (534:34): [True: 0, False: 0]
  ------------------
  535|      0|            if (apr_isxdigit(path[l + 1]) && apr_isxdigit(path[l + 2])) {
  ------------------
  |  |  229|      0|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (229:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          if (apr_isxdigit(path[l + 1]) && apr_isxdigit(path[l + 2])) {
  ------------------
  |  |  229|      0|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (229:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  536|      0|                const char c = x2c(&path[l + 1]);
  537|      0|                if (TEST_CHAR(c, T_URI_UNRESERVED)) {
  ------------------
  |  |   53|      0|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  538|       |                    /* Replace last char and fall through as the current
  539|       |                     * read position */
  540|      0|                    l += 2;
  541|      0|                    path[l] = c;
  542|      0|                }
  543|      0|            }
  544|      0|            else {
  545|       |                /* Invalid encoding */
  546|      0|                ret = 0;
  547|      0|            }
  548|      0|        }
  549|       |
  550|  14.9k|        if (w == 0 || IS_SLASH(path[w - 1])) {
  ------------------
  |  |   87|  14.3k|#define IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (87:21): [True: 845, False: 13.5k]
  |  |  ------------------
  ------------------
  |  Branch (550:13): [True: 516, False: 14.3k]
  ------------------
  551|       |            /* Collapse ///// sequences to / */
  552|  1.36k|            if (merge_slashes && IS_SLASH(path[l])) {
  ------------------
  |  |   87|      0|#define IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (87:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (552:17): [True: 0, False: 1.36k]
  ------------------
  553|      0|                do {
  554|      0|                    l++;
  555|      0|                } while (IS_SLASH(path[l]));
  ------------------
  |  |   87|      0|#define IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (87:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  556|      0|                continue;
  557|      0|            }
  558|       |
  559|  1.36k|            if (path[l] == '.') {
  ------------------
  |  Branch (559:17): [True: 573, False: 788]
  ------------------
  560|       |                /* Remove /./ segments */
  561|    573|                if (IS_SLASH_OR_NUL(path[l + 1])) {
  ------------------
  |  |  497|    573|#define IS_SLASH_OR_NUL(s) (s == '\0' || IS_SLASH(s))
  |  |  ------------------
  |  |  |  |   87|    570|#define IS_SLASH(s) (s == '/')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (87:21): [True: 150, False: 420]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (497:29): [True: 3, False: 570]
  |  |  ------------------
  ------------------
  562|    153|                    l++;
  563|    153|                    if (path[l]) {
  ------------------
  |  Branch (563:25): [True: 150, False: 3]
  ------------------
  564|    150|                        l++;
  565|    150|                    }
  566|    153|                    continue;
  567|    153|                }
  568|       |
  569|       |                /* Remove /xx/../ segments (or /xx/.%2e/ when
  570|       |                 * AP_NORMALIZE_DECODE_UNRESERVED is set since we
  571|       |                 * decoded only the first dot above).
  572|       |                 */
  573|    420|                n = l + 1;
  574|    420|                if ((path[n] == '.' || (decode_unreserved
  ------------------
  |  Branch (574:22): [True: 317, False: 103]
  |  Branch (574:41): [True: 0, False: 103]
  ------------------
  575|    103|                                        && path[n] == '%'
  ------------------
  |  Branch (575:44): [True: 0, False: 0]
  ------------------
  576|    103|                                        && path[++n] == '2'
  ------------------
  |  Branch (576:44): [True: 0, False: 0]
  ------------------
  577|    103|                                        && (path[++n] == 'e'
  ------------------
  |  Branch (577:45): [True: 0, False: 0]
  ------------------
  578|      0|                                            || path[n] == 'E')))
  ------------------
  |  Branch (578:48): [True: 0, False: 0]
  ------------------
  579|    420|                        && IS_SLASH_OR_NUL(path[n + 1])) {
  ------------------
  |  |  497|    317|#define IS_SLASH_OR_NUL(s) (s == '\0' || IS_SLASH(s))
  |  |  ------------------
  |  |  |  |   87|    310|#define IS_SLASH(s) (s == '/')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (87:21): [True: 227, False: 83]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (497:29): [True: 7, False: 310]
  |  |  ------------------
  ------------------
  580|       |                    /* Wind w back to remove the previous segment */
  581|    234|                    if (w > 1) {
  ------------------
  |  Branch (581:25): [True: 151, False: 83]
  ------------------
  582|    623|                        do {
  583|    623|                            w--;
  584|    623|                        } while (w && !IS_SLASH(path[w - 1]));
  ------------------
  |  |   87|    559|#define IS_SLASH(s) (s == '/')
  ------------------
  |  Branch (584:34): [True: 559, False: 64]
  |  Branch (584:39): [True: 472, False: 87]
  ------------------
  585|    151|                    }
  586|     83|                    else {
  587|       |                        /* Already at root, ignore and return a failure
  588|       |                         * if asked to.
  589|       |                         */
  590|     83|                        if (flags & AP_NORMALIZE_NOT_ABOVE_ROOT) {
  ------------------
  |  | 1852|     83|#define AP_NORMALIZE_NOT_ABOVE_ROOT     (1u <<  1)
  ------------------
  |  Branch (590:29): [True: 83, False: 0]
  ------------------
  591|     83|                            ret = 0;
  592|     83|                        }
  593|     83|                    }
  594|       |
  595|       |                    /* Move l forward to the next segment */
  596|    234|                    l = n + 1;
  597|    234|                    if (path[l]) {
  ------------------
  |  Branch (597:25): [True: 227, False: 7]
  ------------------
  598|    227|                        l++;
  599|    227|                    }
  600|    234|                    continue;
  601|    234|                }
  602|    420|            }
  603|  1.36k|        }
  604|       |
  605|  14.5k|        path[w++] = path[l++];
  606|  14.5k|    }
  607|    350|    path[w] = '\0';
  608|       |
  609|    350|    return ret;
  610|    397|}
ap_getparents:
  616|    397|{
  617|    397|    if (!ap_normalize_path(name, AP_NORMALIZE_NOT_ABOVE_ROOT |
  ------------------
  |  | 1852|    397|#define AP_NORMALIZE_NOT_ABOVE_ROOT     (1u <<  1)
  ------------------
  |  Branch (617:9): [True: 62, False: 335]
  ------------------
  618|    397|                                 AP_NORMALIZE_ALLOW_RELATIVE)) {
  ------------------
  |  | 1851|    397|#define AP_NORMALIZE_ALLOW_RELATIVE     (1u <<  0)
  ------------------
  619|     62|        name[0] = '\0';
  620|     62|    }
  621|    397|}
ap_no2slash_ex:
  624|    320|{
  625|       |
  626|    320|    char *d, *s;
  627|       |
  628|    320|    if (!*name) {
  ------------------
  |  Branch (628:9): [True: 42, False: 278]
  ------------------
  629|     42|        return;
  630|     42|    }
  631|       |
  632|    278|    s = d = name;
  633|       |
  634|       |#ifdef HAVE_UNC_PATHS
  635|       |    /* Check for UNC names.  Leave leading two slashes. */
  636|       |    if (is_fs_path && s[0] == '/' && s[1] == '/')
  637|       |        *d++ = *s++;
  638|       |#endif
  639|       |
  640|  12.7k|    while (*s) {
  ------------------
  |  Branch (640:12): [True: 12.5k, False: 278]
  ------------------
  641|  12.5k|        if ((*d++ = *s) == '/') {
  ------------------
  |  Branch (641:13): [True: 180, False: 12.3k]
  ------------------
  642|    480|            do {
  643|    480|                ++s;
  644|    480|            } while (*s == '/');
  ------------------
  |  Branch (644:22): [True: 300, False: 180]
  ------------------
  645|    180|        }
  646|  12.3k|        else {
  647|  12.3k|            ++s;
  648|  12.3k|        }
  649|  12.5k|    }
  650|    278|    *d = '\0';
  651|    278|}
ap_no2slash:
  654|    320|{
  655|    320|    ap_no2slash_ex(name, 1);
  656|    320|}
ap_make_dirstr_parent:
  706|    208|{
  707|    208|    const char *last_slash = ap_strrchr_c(s, '/');
  ------------------
  |  | 2508|    208|# define ap_strrchr_c(s, c)  strrchr(s, c)
  ------------------
  708|    208|    char *d;
  709|    208|    int l;
  710|       |
  711|    208|    if (last_slash == NULL) {
  ------------------
  |  Branch (711:9): [True: 195, False: 13]
  ------------------
  712|    195|        return apr_pstrdup(p, "");
  713|    195|    }
  714|     13|    l = (last_slash - s) + 1;
  715|     13|    d = apr_pstrmemdup(p, s, l);
  716|       |
  717|     13|    return (d);
  718|    208|}
ap_getword:
  737|  1.26k|{
  738|  1.26k|    const char *pos = *line;
  739|  1.26k|    int len;
  740|  1.26k|    char *res;
  741|       |
  742|  56.2k|    while ((*pos != stop) && *pos) {
  ------------------
  |  Branch (742:12): [True: 54.9k, False: 1.26k]
  |  Branch (742:30): [True: 54.9k, False: 0]
  ------------------
  743|  54.9k|        ++pos;
  744|  54.9k|    }
  745|       |
  746|  1.26k|    len = pos - *line;
  747|  1.26k|    res = apr_pstrmemdup(atrans, *line, len);
  748|       |
  749|  1.26k|    if (stop) {
  ------------------
  |  Branch (749:9): [True: 0, False: 1.26k]
  ------------------
  750|      0|        while (*pos == stop) {
  ------------------
  |  Branch (750:16): [True: 0, False: 0]
  ------------------
  751|      0|            ++pos;
  752|      0|        }
  753|      0|    }
  754|  1.26k|    *line = pos;
  755|       |
  756|  1.26k|    return res;
  757|  1.26k|}
ap_getword_white_nc:
  760|    167|{
  761|    167|    return ap_getword_white(atrans, (const char **) line);
  762|    167|}
ap_getword_white:
  765|    167|{
  766|    167|    const char *pos = *line;
  767|    167|    int len;
  768|    167|    char *res;
  769|       |
  770|  1.51k|    while (!apr_isspace(*pos) && *pos) {
  ------------------
  |  |  225|  3.03k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (770:12): [True: 1.42k, False: 95]
  |  Branch (770:34): [True: 1.34k, False: 72]
  ------------------
  771|  1.34k|        ++pos;
  772|  1.34k|    }
  773|       |
  774|    167|    len = pos - *line;
  775|    167|    res = apr_pstrmemdup(atrans, *line, len);
  776|       |
  777|    696|    while (apr_isspace(*pos)) {
  ------------------
  |  |  225|    696|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 529, False: 167]
  |  |  ------------------
  ------------------
  778|    529|        ++pos;
  779|    529|    }
  780|       |
  781|    167|    *line = pos;
  782|       |
  783|    167|    return res;
  784|    167|}
ap_getword_conf:
  847|    109|{
  848|    109|    const char *str = *line, *strend;
  849|    109|    char *res;
  850|    109|    char quote;
  851|       |
  852|    283|    while (apr_isspace(*str))
  ------------------
  |  |  225|    283|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 174, False: 109]
  |  |  ------------------
  ------------------
  853|    174|        ++str;
  854|       |
  855|    109|    if (!*str) {
  ------------------
  |  Branch (855:9): [True: 0, False: 109]
  ------------------
  856|      0|        *line = str;
  857|      0|        return "";
  858|      0|    }
  859|       |
  860|    109|    if ((quote = *str) == '"' || quote == '\'') {
  ------------------
  |  Branch (860:9): [True: 32, False: 77]
  |  Branch (860:34): [True: 77, False: 0]
  ------------------
  861|    109|        strend = str + 1;
  862|  3.89k|        while (*strend && *strend != quote) {
  ------------------
  |  Branch (862:16): [True: 3.81k, False: 78]
  |  Branch (862:27): [True: 3.78k, False: 31]
  ------------------
  863|  3.78k|            if (*strend == '\\' && strend[1] &&
  ------------------
  |  Branch (863:17): [True: 506, False: 3.27k]
  |  Branch (863:36): [True: 496, False: 10]
  ------------------
  864|  3.78k|                (strend[1] == quote || strend[1] == '\\')) {
  ------------------
  |  Branch (864:18): [True: 119, False: 377]
  |  Branch (864:40): [True: 196, False: 181]
  ------------------
  865|    315|                strend += 2;
  866|    315|            }
  867|  3.46k|            else {
  868|  3.46k|                ++strend;
  869|  3.46k|            }
  870|  3.78k|        }
  871|    109|        res = substring_conf(p, str + 1, strend - str - 1, quote);
  872|       |
  873|    109|        if (*strend == quote)
  ------------------
  |  Branch (873:13): [True: 31, False: 78]
  ------------------
  874|     31|            ++strend;
  875|    109|    }
  876|      0|    else {
  877|      0|        strend = str;
  878|      0|        while (*strend && !apr_isspace(*strend))
  ------------------
  |  |  225|      0|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (878:16): [True: 0, False: 0]
  |  Branch (878:27): [True: 0, False: 0]
  ------------------
  879|      0|            ++strend;
  880|       |
  881|      0|        res = substring_conf(p, str, strend - str, 0);
  882|      0|    }
  883|       |
  884|    244|    while (apr_isspace(*strend))
  ------------------
  |  |  225|    244|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 135, False: 109]
  |  |  ------------------
  ------------------
  885|    135|        ++strend;
  886|    109|    *line = strend;
  887|    109|    return res;
  888|    109|}
ap_getword_conf2:
  896|  1.26k|{
  897|  1.26k|    const char *str = *line, *strend;
  898|  1.26k|    char *res;
  899|  1.26k|    char quote;
  900|  1.26k|    int count = 1;
  901|       |
  902|  2.26k|    while (apr_isspace(*str))
  ------------------
  |  |  225|  2.26k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 996, False: 1.26k]
  |  |  ------------------
  ------------------
  903|    996|        ++str;
  904|       |
  905|  1.26k|    if (!*str) {
  ------------------
  |  Branch (905:9): [True: 17, False: 1.24k]
  ------------------
  906|     17|        *line = str;
  907|     17|        return "";
  908|     17|    }
  909|       |
  910|  1.24k|    if ((quote = *str) == '"' || quote == '\'')
  ------------------
  |  Branch (910:9): [True: 32, False: 1.21k]
  |  Branch (910:34): [True: 77, False: 1.13k]
  ------------------
  911|    109|        return ap_getword_conf(p, line);
  912|       |
  913|  1.13k|    if (quote == '{') {
  ------------------
  |  Branch (913:9): [True: 87, False: 1.05k]
  ------------------
  914|     87|        strend = str + 1;
  915|  3.50k|        while (*strend) {
  ------------------
  |  Branch (915:16): [True: 3.41k, False: 81]
  ------------------
  916|  3.41k|            if (*strend == '}' && !--count)
  ------------------
  |  Branch (916:17): [True: 93, False: 3.32k]
  |  Branch (916:35): [True: 6, False: 87]
  ------------------
  917|      6|                break;
  918|  3.41k|            if (*strend == '{')
  ------------------
  |  Branch (918:17): [True: 468, False: 2.94k]
  ------------------
  919|    468|                ++count;
  920|  3.41k|            if (*strend == '\\' && strend[1] == '\\') {
  ------------------
  |  Branch (920:17): [True: 488, False: 2.92k]
  |  Branch (920:36): [True: 222, False: 266]
  ------------------
  921|    222|                ++strend;
  922|    222|            }
  923|  3.41k|            ++strend;
  924|  3.41k|        }
  925|     87|        res = substring_conf(p, str + 1, strend - str - 1, 0);
  926|       |
  927|     87|        if (*strend == '}')
  ------------------
  |  Branch (927:13): [True: 6, False: 81]
  ------------------
  928|      6|            ++strend;
  929|     87|    }
  930|  1.05k|    else {
  931|  1.05k|        strend = str;
  932|  26.4k|        while (*strend && !apr_isspace(*strend))
  ------------------
  |  |  225|  25.8k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (932:16): [True: 25.8k, False: 533]
  |  Branch (932:27): [True: 25.3k, False: 518]
  ------------------
  933|  25.3k|            ++strend;
  934|       |
  935|  1.05k|        res = substring_conf(p, str, strend - str, 0);
  936|  1.05k|    }
  937|       |
  938|  3.17k|    while (apr_isspace(*strend))
  ------------------
  |  |  225|  3.17k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 2.03k, False: 1.13k]
  |  |  ------------------
  ------------------
  939|  2.03k|        ++strend;
  940|  1.13k|    *line = strend;
  941|  1.13k|    return res;
  942|  1.24k|}
ap_pcfg_openfile:
  972|  1.26k|{
  973|  1.26k|    ap_configfile_t *new_cfg;
  974|  1.26k|    apr_file_t *file = NULL;
  975|  1.26k|    apr_finfo_t finfo;
  976|  1.26k|    apr_status_t status;
  977|       |#ifdef DEBUG
  978|       |    char buf[120];
  979|       |#endif
  980|       |
  981|  1.26k|    if (name == NULL) {
  ------------------
  |  Branch (981:9): [True: 0, False: 1.26k]
  ------------------
  982|      0|        ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, APLOGNO(00552)
  ------------------
  |  |  363|      0|#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  366|      0|    do { const server_rec *sr__ = s; if (APLOG_MODULE_IS_LEVEL(sr__, mi, level)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|      0|          ( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) ||       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define APLOG_LEVELMASK 15     /* mask off the level value */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                         ( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) ||       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   48|      0|#define APLOG_NOTICE    LOG_NOTICE      /* normal but significant condition */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (183:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|            (s == NULL) ||                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (184:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  185|      0|            (ap_get_server_module_loglevel(s, module_index)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  629|      0|    (ap_get_module_loglevel(&(s)->log,i))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  624|      0|    (((i) < 0 || (l)->module_levels == NULL || (l)->module_levels[i] < 0) ?  \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:7): [Folded - Ignored]
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:18): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:48): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  625|      0|     (l)->level :                                                         \
  |  |  |  |  |  |  |  |  |  |  626|      0|     (l)->module_levels[i])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (185:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  186|      0|             >= ((level)&APLOG_LEVELMASK) ) )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define APLOG_LEVELMASK 15     /* mask off the level value */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  367|      0|             ap_log_error_(file, line, mi, level, status, sr__, __VA_ARGS__);    \
  |  |  |  |  368|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  983|      0|               "Internal error: pcfg_openfile() called with NULL filename");
  984|      0|        return APR_EBADF;
  ------------------
  |  |  708|      0|#define APR_EBADF EBADF
  ------------------
  985|      0|    }
  986|       |
  987|  1.26k|    status = apr_file_open(&file, name, APR_READ | APR_BUFFERED,
  ------------------
  |  |  100|  1.26k|#define APR_READ             APR_FOPEN_READ       /**< @deprecated @see APR_FOPEN_READ */
  |  |  ------------------
  |  |  |  |   54|  1.26k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  |  |  ------------------
  ------------------
                  status = apr_file_open(&file, name, APR_READ | APR_BUFFERED,
  ------------------
  |  |  107|  1.26k|#define APR_BUFFERED         APR_FOPEN_BUFFERED   /**< @deprecated @see APR_FOPEN_BUFFERED */
  |  |  ------------------
  |  |  |  |   65|  1.26k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  |  |  ------------------
  ------------------
  988|  1.26k|                           APR_OS_DEFAULT, p);
  ------------------
  |  |  112|  1.26k|#define APR_OS_DEFAULT APR_FPROT_OS_DEFAULT /**< @deprecated @see APR_FPROT_OS_DEFAULT */
  |  |  ------------------
  |  |  |  |   94|  1.26k|#define APR_FPROT_OS_DEFAULT  0x0FFF /**< use OS's default permissions */
  |  |  ------------------
  ------------------
  989|       |#ifdef DEBUG
  990|       |    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, APLOGNO(00553)
  991|       |                "Opening config file %s (%s)",
  992|       |                name, (status != APR_SUCCESS) ?
  993|       |                apr_strerror(status, buf, sizeof(buf)) : "successful");
  994|       |#endif
  995|  1.26k|    if (status != APR_SUCCESS)
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  |  Branch (995:9): [True: 0, False: 1.26k]
  ------------------
  996|      0|        return status;
  997|       |
  998|  1.26k|    status = apr_file_info_get(&finfo, APR_FINFO_TYPE, file);
  ------------------
  |  |  154|  1.26k|#define APR_FINFO_TYPE   0x00008000 /**< Type */
  ------------------
  999|  1.26k|    if (status != APR_SUCCESS)
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  |  Branch (999:9): [True: 0, False: 1.26k]
  ------------------
 1000|      0|        return status;
 1001|       |
 1002|  1.26k|    if (finfo.filetype != APR_REG &&
  ------------------
  |  Branch (1002:9): [True: 0, False: 1.26k]
  ------------------
 1003|       |#if defined(WIN32) || defined(OS2) || defined(NETWARE)
 1004|       |        ap_cstr_casecmp(apr_filepath_name_get(name), "nul") != 0) {
 1005|       |#else
 1006|  1.26k|        strcmp(name, "/dev/null") != 0) {
  ------------------
  |  Branch (1006:9): [True: 0, False: 0]
  ------------------
 1007|      0|#endif /* WIN32 || OS2 */
 1008|      0|        ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, APLOGNO(00554)
  ------------------
  |  |  363|      0|#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  366|      0|    do { const server_rec *sr__ = s; if (APLOG_MODULE_IS_LEVEL(sr__, mi, level)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|      0|          ( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) ||       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define APLOG_LEVELMASK 15     /* mask off the level value */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                         ( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) ||       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   48|      0|#define APLOG_NOTICE    LOG_NOTICE      /* normal but significant condition */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (183:13): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|            (s == NULL) ||                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (184:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  185|      0|            (ap_get_server_module_loglevel(s, module_index)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  629|      0|    (ap_get_module_loglevel(&(s)->log,i))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  624|      0|    (((i) < 0 || (l)->module_levels == NULL || (l)->module_levels[i] < 0) ?  \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:7): [Folded - Ignored]
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:18): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:48): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  625|      0|     (l)->level :                                                         \
  |  |  |  |  |  |  |  |  |  |  626|      0|     (l)->module_levels[i])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (185:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  186|      0|             >= ((level)&APLOG_LEVELMASK) ) )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define APLOG_LEVELMASK 15     /* mask off the level value */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  367|      0|             ap_log_error_(file, line, mi, level, status, sr__, __VA_ARGS__);    \
  |  |  |  |  368|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1009|      0|                     "Access to file %s denied by server: not a regular file",
 1010|      0|                     name);
 1011|      0|        apr_file_close(file);
 1012|      0|        return APR_EBADF;
  ------------------
  |  |  708|      0|#define APR_EBADF EBADF
  ------------------
 1013|      0|    }
 1014|       |
 1015|       |#ifdef WIN32
 1016|       |    /* Some twisted character [no pun intended] at MS decided that a
 1017|       |     * zero width joiner as the lead wide character would be ideal for
 1018|       |     * describing Unicode text files.  This was further convoluted to
 1019|       |     * another MSism that the same character mapped into utf-8, EF BB BF
 1020|       |     * would signify utf-8 text files.
 1021|       |     *
 1022|       |     * Since MS configuration files are all protecting utf-8 encoded
 1023|       |     * Unicode path, file and resource names, we already have the correct
 1024|       |     * WinNT encoding.  But at least eat the stupid three bytes up front.
 1025|       |     */
 1026|       |    {
 1027|       |        unsigned char buf[4];
 1028|       |        apr_size_t len = 3;
 1029|       |        status = apr_file_read(file, buf, &len);
 1030|       |        if ((status != APR_SUCCESS) || (len < 3)
 1031|       |              || memcmp(buf, "\xEF\xBB\xBF", 3) != 0) {
 1032|       |            apr_off_t zero = 0;
 1033|       |            apr_file_seek(file, APR_SET, &zero);
 1034|       |        }
 1035|       |    }
 1036|       |#endif
 1037|       |
 1038|  1.26k|    new_cfg = apr_palloc(p, sizeof(*new_cfg));
  ------------------
  |  |  425|  1.26k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1039|  1.26k|    new_cfg->param = file;
 1040|  1.26k|    new_cfg->name = apr_pstrdup(p, name);
 1041|  1.26k|    new_cfg->getch = cfg_getch;
 1042|  1.26k|    new_cfg->getstr = cfg_getstr;
 1043|  1.26k|    new_cfg->close = cfg_close;
 1044|  1.26k|    new_cfg->line_number = 0;
 1045|  1.26k|    *ret_cfg = new_cfg;
 1046|  1.26k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
 1047|  1.26k|}
ap_cfg_getline:
 1213|  1.26k|{
 1214|  1.26k|    apr_status_t rc = ap_cfg_getline_core(buf, bufsize, 0, cfp);
 1215|  1.26k|    if (rc == APR_SUCCESS)
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1215:9): [True: 1.06k, False: 199]
  ------------------
 1216|  1.06k|        cfg_trim_line(buf);
 1217|  1.26k|    return rc;
 1218|  1.26k|}
ap_size_list_item:
 1268|  1.26k|{
 1269|  1.26k|    const unsigned char *ptr = (const unsigned char *)*field;
 1270|  1.26k|    const unsigned char *token;
 1271|  1.26k|    int in_qpair, in_qstr, in_com;
 1272|       |
 1273|       |    /* Find first non-comma, non-whitespace byte */
 1274|       |
 1275|  2.65k|    while (*ptr == ',' || apr_isspace(*ptr))
  ------------------
  |  |  225|  2.29k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 1.03k, False: 1.26k]
  |  |  ------------------
  ------------------
  |  Branch (1275:12): [True: 359, False: 2.29k]
  ------------------
 1276|  1.38k|        ++ptr;
 1277|       |
 1278|  1.26k|    token = ptr;
 1279|       |
 1280|       |    /* Find the end of this item, skipping over dead bits */
 1281|       |
 1282|  1.26k|    for (in_qpair = in_qstr = in_com = 0;
 1283|  43.1k|         *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1283:10): [True: 42.1k, False: 999]
  |  Branch (1283:19): [True: 2.96k, False: 39.2k]
  |  Branch (1283:31): [True: 3.58k, False: 35.6k]
  |  Branch (1283:42): [True: 4.12k, False: 31.5k]
  |  Branch (1283:52): [True: 31.2k, False: 265]
  ------------------
 1284|  41.9k|         ++ptr) {
 1285|       |
 1286|  41.9k|        if (in_qpair) {
  ------------------
  |  Branch (1286:13): [True: 2.96k, False: 38.9k]
  ------------------
 1287|  2.96k|            in_qpair = 0;
 1288|  2.96k|        }
 1289|  38.9k|        else {
 1290|  38.9k|            switch (*ptr) {
 1291|  2.99k|                case '\\': in_qpair = 1;      /* quoted-pair         */
  ------------------
  |  Branch (1291:17): [True: 2.99k, False: 35.9k]
  ------------------
 1292|  2.99k|                           break;
 1293|  1.17k|                case '"' : if (!in_com)       /* quoted string delim */
  ------------------
  |  Branch (1293:17): [True: 1.17k, False: 37.7k]
  |  Branch (1293:32): [True: 877, False: 302]
  ------------------
 1294|    877|                               in_qstr = !in_qstr;
 1295|  1.17k|                           break;
 1296|  1.24k|                case '(' : if (!in_qstr)      /* comment (may nest)  */
  ------------------
  |  Branch (1296:17): [True: 1.24k, False: 37.7k]
  |  Branch (1296:32): [True: 1.07k, False: 171]
  ------------------
 1297|  1.07k|                               ++in_com;
 1298|  1.24k|                           break;
 1299|    498|                case ')' : if (in_com)        /* end comment         */
  ------------------
  |  Branch (1299:17): [True: 498, False: 38.4k]
  |  Branch (1299:32): [True: 246, False: 252]
  ------------------
 1300|    246|                               --in_com;
 1301|    498|                           break;
 1302|  33.0k|                default  : break;
  ------------------
  |  Branch (1302:17): [True: 33.0k, False: 5.91k]
  ------------------
 1303|  38.9k|            }
 1304|  38.9k|        }
 1305|  41.9k|    }
 1306|       |
 1307|  1.26k|    if ((*len = (ptr - token)) == 0) {
  ------------------
  |  Branch (1307:9): [True: 21, False: 1.24k]
  ------------------
 1308|     21|        *field = (const char *)ptr;
 1309|     21|        return NULL;
 1310|     21|    }
 1311|       |
 1312|       |    /* Advance field pointer to the next non-comma, non-white byte */
 1313|       |
 1314|  2.08k|    while (*ptr == ',' || apr_isspace(*ptr))
  ------------------
  |  |  225|  1.44k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 197, False: 1.24k]
  |  |  ------------------
  ------------------
  |  Branch (1314:12): [True: 643, False: 1.44k]
  ------------------
 1315|    840|        ++ptr;
 1316|       |
 1317|  1.24k|    *field = (const char *)ptr;
 1318|  1.24k|    return (const char *)token;
 1319|  1.26k|}
ap_get_list_item:
 1328|  1.26k|{
 1329|  1.26k|    const char *tok_start;
 1330|  1.26k|    const unsigned char *ptr;
 1331|  1.26k|    unsigned char *pos;
 1332|  1.26k|    char *token;
 1333|  1.26k|    int addspace = 0, in_qpair = 0, in_qstr = 0, in_com = 0, tok_len = 0;
 1334|       |
 1335|       |    /* Find the beginning and maximum length of the list item so that
 1336|       |     * we can allocate a buffer for the new string and reset the field.
 1337|       |     */
 1338|  1.26k|    if ((tok_start = ap_size_list_item(field, &tok_len)) == NULL) {
  ------------------
  |  Branch (1338:9): [True: 21, False: 1.24k]
  ------------------
 1339|     21|        return NULL;
 1340|     21|    }
 1341|  1.24k|    token = apr_palloc(p, tok_len + 1);
  ------------------
  |  |  425|  1.24k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.24k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.24k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.24k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1342|       |
 1343|       |    /* Scan the token again, but this time copy only the good bytes.
 1344|       |     * We skip extra whitespace and any whitespace around a '=', '/',
 1345|       |     * or ';' and lowercase normal characters not within a comment,
 1346|       |     * quoted-string or quoted-pair.
 1347|       |     */
 1348|  1.24k|    for (ptr = (const unsigned char *)tok_start, pos = (unsigned char *)token;
 1349|  43.1k|         *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1349:10): [True: 42.1k, False: 978]
  |  Branch (1349:19): [True: 2.96k, False: 39.2k]
  |  Branch (1349:31): [True: 3.58k, False: 35.6k]
  |  Branch (1349:42): [True: 4.12k, False: 31.5k]
  |  Branch (1349:52): [True: 31.2k, False: 265]
  ------------------
 1350|  41.9k|         ++ptr) {
 1351|       |
 1352|  41.9k|        if (in_qpair) {
  ------------------
  |  Branch (1352:13): [True: 2.96k, False: 38.9k]
  ------------------
 1353|  2.96k|            in_qpair = 0;
 1354|  2.96k|            *pos++ = *ptr;
 1355|  2.96k|        }
 1356|  38.9k|        else {
 1357|  38.9k|            switch (*ptr) {
 1358|  2.99k|                case '\\': in_qpair = 1;
  ------------------
  |  Branch (1358:17): [True: 2.99k, False: 35.9k]
  ------------------
 1359|  2.99k|                           if (addspace == 1)
  ------------------
  |  Branch (1359:32): [True: 94, False: 2.90k]
  ------------------
 1360|     94|                               *pos++ = ' ';
 1361|  2.99k|                           *pos++ = *ptr;
 1362|  2.99k|                           addspace = 0;
 1363|  2.99k|                           break;
 1364|  1.17k|                case '"' : if (!in_com)
  ------------------
  |  Branch (1364:17): [True: 1.17k, False: 37.7k]
  |  Branch (1364:32): [True: 877, False: 302]
  ------------------
 1365|    877|                               in_qstr = !in_qstr;
 1366|  1.17k|                           if (addspace == 1)
  ------------------
  |  Branch (1366:32): [True: 91, False: 1.08k]
  ------------------
 1367|     91|                               *pos++ = ' ';
 1368|  1.17k|                           *pos++ = *ptr;
 1369|  1.17k|                           addspace = 0;
 1370|  1.17k|                           break;
 1371|  1.24k|                case '(' : if (!in_qstr)
  ------------------
  |  Branch (1371:17): [True: 1.24k, False: 37.7k]
  |  Branch (1371:32): [True: 1.07k, False: 171]
  ------------------
 1372|  1.07k|                               ++in_com;
 1373|  1.24k|                           if (addspace == 1)
  ------------------
  |  Branch (1373:32): [True: 100, False: 1.14k]
  ------------------
 1374|    100|                               *pos++ = ' ';
 1375|  1.24k|                           *pos++ = *ptr;
 1376|  1.24k|                           addspace = 0;
 1377|  1.24k|                           break;
 1378|    498|                case ')' : if (in_com)
  ------------------
  |  Branch (1378:17): [True: 498, False: 38.4k]
  |  Branch (1378:32): [True: 246, False: 252]
  ------------------
 1379|    246|                               --in_com;
 1380|    498|                           *pos++ = *ptr;
 1381|    498|                           addspace = 0;
 1382|    498|                           break;
 1383|  2.35k|                case ' ' :
  ------------------
  |  Branch (1383:17): [True: 2.35k, False: 36.6k]
  ------------------
 1384|  3.45k|                case '\t': if (addspace)
  ------------------
  |  Branch (1384:17): [True: 1.10k, False: 37.8k]
  |  Branch (1384:32): [True: 1.84k, False: 1.61k]
  ------------------
 1385|  1.84k|                               break;
 1386|  1.61k|                           if (in_com || in_qstr)
  ------------------
  |  Branch (1386:32): [True: 436, False: 1.17k]
  |  Branch (1386:42): [True: 396, False: 783]
  ------------------
 1387|    832|                               *pos++ = *ptr;
 1388|    783|                           else
 1389|    783|                               addspace = 1;
 1390|  1.61k|                           break;
 1391|    350|                case '=' :
  ------------------
  |  Branch (1391:17): [True: 350, False: 38.6k]
  ------------------
 1392|  1.13k|                case '/' :
  ------------------
  |  Branch (1392:17): [True: 786, False: 38.1k]
  ------------------
 1393|  1.61k|                case ';' : if (!(in_com || in_qstr))
  ------------------
  |  Branch (1393:17): [True: 474, False: 38.4k]
  |  Branch (1393:34): [True: 163, False: 1.44k]
  |  Branch (1393:44): [True: 229, False: 1.21k]
  ------------------
 1394|  1.21k|                               addspace = -1;
 1395|  1.61k|                           *pos++ = *ptr;
 1396|  1.61k|                           break;
 1397|  27.9k|                default  : if (addspace == 1)
  ------------------
  |  Branch (1397:17): [True: 27.9k, False: 10.9k]
  |  Branch (1397:32): [True: 426, False: 27.5k]
  ------------------
 1398|    426|                               *pos++ = ' ';
 1399|  27.9k|                           *pos++ = (in_com || in_qstr) ? *ptr
  ------------------
  |  Branch (1399:38): [True: 1.98k, False: 25.9k]
  |  Branch (1399:48): [True: 2.00k, False: 23.9k]
  ------------------
 1400|  27.9k|                                                        : apr_tolower(*ptr);
  ------------------
  |  |  231|  51.9k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
 1401|  27.9k|                           addspace = 0;
 1402|  27.9k|                           break;
 1403|  38.9k|            }
 1404|  38.9k|        }
 1405|  41.9k|    }
 1406|  1.24k|    *pos = '\0';
 1407|       |
 1408|  1.24k|    return token;
 1409|  1.24k|}
ap_find_list_item:
 1552|  1.26k|{
 1553|  1.26k|    return find_list_item(p, line, tok, AP_ETAG_NONE);
 1554|  1.26k|}
ap_parse_token_list_strict:
 1579|  1.26k|{
 1580|  1.26k|    int in_leading_space = 1;
 1581|  1.26k|    int in_trailing_space = 0;
 1582|  1.26k|    int string_end = 0;
 1583|  1.26k|    const char *tok_begin;
 1584|  1.26k|    const char *cur;
 1585|       |
 1586|  1.26k|    if (!str_in) {
  ------------------
  |  Branch (1586:9): [True: 0, False: 1.26k]
  ------------------
 1587|      0|        return NULL;
 1588|      0|    }
 1589|       |
 1590|  1.26k|    tok_begin = cur = str_in;
 1591|       |
 1592|  14.5k|    while (!string_end) {
  ------------------
  |  Branch (1592:12): [True: 14.3k, False: 213]
  ------------------
 1593|  14.3k|        const unsigned char c = (unsigned char)*cur;
 1594|       |
 1595|  14.3k|        if (!TEST_CHAR(c, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  14.3k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  ------------------
  |  Branch (1595:13): [True: 10.1k, False: 4.20k]
  ------------------
 1596|       |            /* Non-separator character; we are finished with leading
 1597|       |             * whitespace. We must never have encountered any trailing
 1598|       |             * whitespace before the delimiter (comma) */
 1599|  10.1k|            in_leading_space = 0;
 1600|  10.1k|            if (in_trailing_space) {
  ------------------
  |  Branch (1600:17): [True: 36, False: 10.1k]
  ------------------
 1601|     36|                return "Encountered illegal whitespace in token";
 1602|     36|            }
 1603|  10.1k|        }
 1604|  4.20k|        else if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (1604:18): [True: 1.01k, False: 3.19k]
  |  Branch (1604:30): [True: 446, False: 2.75k]
  ------------------
 1605|       |            /* "Linear whitespace" only includes ASCII CRLF, space, and tab;
 1606|       |             * we can't get a CRLF since headers are split on them already,
 1607|       |             * so only look for a space or a tab */
 1608|  1.45k|            if (in_leading_space) {
  ------------------
  |  Branch (1608:17): [True: 722, False: 737]
  ------------------
 1609|       |                /* We're still in leading whitespace */
 1610|    722|                ++tok_begin;
 1611|    722|            }
 1612|    737|            else {
 1613|       |                /* We must be in trailing whitespace */
 1614|    737|                ++in_trailing_space;
 1615|    737|            }
 1616|  1.45k|        }
 1617|  2.75k|        else if (c == ',' || c == '\0') {
  ------------------
  |  Branch (1617:18): [True: 1.52k, False: 1.22k]
  |  Branch (1617:30): [True: 213, False: 1.01k]
  ------------------
 1618|  1.73k|            if (!in_leading_space) {
  ------------------
  |  Branch (1618:17): [True: 1.01k, False: 725]
  ------------------
 1619|       |                /* If we're out of the leading space, we know we've read some
 1620|       |                 * characters of a token */
 1621|  1.01k|                if (*tokens == NULL) {
  ------------------
  |  Branch (1621:21): [True: 261, False: 749]
  ------------------
 1622|    261|                    *tokens = apr_array_make(p, 4, sizeof(char *));
 1623|    261|                }
 1624|  1.01k|                APR_ARRAY_PUSH(*tokens, char *) =
  ------------------
  |  |  150|  1.01k|#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
  ------------------
 1625|  1.01k|                    apr_pstrmemdup((*tokens)->pool, tok_begin,
 1626|  1.01k|                                   (cur - tok_begin) - in_trailing_space);
 1627|  1.01k|            }
 1628|       |            /* We're allowed to have null elements, just don't add them to the
 1629|       |             * array */
 1630|       |
 1631|  1.73k|            tok_begin = cur + 1;
 1632|  1.73k|            in_leading_space = 1;
 1633|  1.73k|            in_trailing_space = 0;
 1634|  1.73k|            string_end = (c == '\0');
 1635|  1.73k|        }
 1636|  1.01k|        else {
 1637|       |            /* Encountered illegal separator char */
 1638|  1.01k|            if (skip_invalid) {
  ------------------
  |  Branch (1638:17): [True: 0, False: 1.01k]
  ------------------
 1639|       |                /* Skip to the next separator */
 1640|      0|                const char *temp;
 1641|      0|                temp = ap_strchr_c(cur, ',');
  ------------------
  |  | 2504|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 1642|      0|                if(!temp) {
  ------------------
  |  Branch (1642:20): [True: 0, False: 0]
  ------------------
 1643|      0|                    temp = ap_strchr_c(cur, '\0');
  ------------------
  |  | 2504|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 1644|      0|                }
 1645|       |
 1646|       |                /* Act like we haven't seen a token so we reset */
 1647|      0|                cur = temp - 1;
 1648|      0|                in_leading_space = 1;
 1649|      0|                in_trailing_space = 0;
 1650|      0|            }
 1651|  1.01k|            else {
 1652|  1.01k|                return apr_psprintf(p, "Encountered illegal separator "
 1653|  1.01k|                                    "'\\x%.2x'", (unsigned int)c);
 1654|  1.01k|            }
 1655|  1.01k|        }
 1656|       |
 1657|  13.2k|        ++cur;
 1658|  13.2k|    }
 1659|       |
 1660|    213|    return NULL;
 1661|  1.26k|}
ap_get_token:
 1702|  1.26k|{
 1703|  1.26k|    const char *ptr = *accept_line;
 1704|  1.26k|    const char *tok_start;
 1705|  1.26k|    char *token;
 1706|       |
 1707|       |    /* Find first non-white byte */
 1708|       |
 1709|  2.26k|    while (apr_isspace(*ptr))
  ------------------
  |  |  225|  2.26k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 996, False: 1.26k]
  |  |  ------------------
  ------------------
 1710|    996|        ++ptr;
 1711|       |
 1712|  1.26k|    tok_start = ptr;
 1713|       |
 1714|       |    /* find token end, skipping over quoted strings.
 1715|       |     * (comments are already gone).
 1716|       |     */
 1717|       |
 1718|  34.8k|    while (*ptr && (accept_white || !apr_isspace(*ptr))
  ------------------
  |  |  225|      0|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (1718:12): [True: 33.9k, False: 895]
  |  Branch (1718:21): [True: 33.9k, False: 0]
  |  Branch (1718:37): [True: 0, False: 0]
  ------------------
 1719|  34.8k|           && *ptr != ';' && *ptr != ',') {
  ------------------
  |  Branch (1719:15): [True: 33.8k, False: 57]
  |  Branch (1719:30): [True: 33.5k, False: 312]
  ------------------
 1720|  33.5k|        if (*ptr++ == '"')
  ------------------
  |  Branch (1720:13): [True: 559, False: 33.0k]
  ------------------
 1721|  4.28k|            while (*ptr)
  ------------------
  |  Branch (1721:20): [True: 4.18k, False: 104]
  ------------------
 1722|  4.18k|                if (*ptr++ == '"')
  ------------------
  |  Branch (1722:21): [True: 455, False: 3.72k]
  ------------------
 1723|    455|                    break;
 1724|  33.5k|    }
 1725|       |
 1726|  1.26k|    token = apr_pstrmemdup(p, tok_start, ptr - tok_start);
 1727|       |
 1728|       |    /* Advance accept_line pointer to the next non-white byte */
 1729|       |
 1730|  1.26k|    while (apr_isspace(*ptr))
  ------------------
  |  |  225|  1.26k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 0, False: 1.26k]
  |  |  ------------------
  ------------------
 1731|      0|        ++ptr;
 1732|       |
 1733|  1.26k|    *accept_line = ptr;
 1734|  1.26k|    return token;
 1735|  1.26k|}
ap_find_token:
 1740|  1.26k|{
 1741|  1.26k|    const unsigned char *start_token;
 1742|  1.26k|    const unsigned char *s;
 1743|       |
 1744|  1.26k|    if (!line)
  ------------------
  |  Branch (1744:9): [True: 0, False: 1.26k]
  ------------------
 1745|      0|        return 0;
 1746|       |
 1747|  1.26k|    s = (const unsigned char *)line;
 1748|  5.65k|    for (;;) {
 1749|       |        /* find start of token, skip all stop characters */
 1750|  38.2k|        while (*s && TEST_CHAR(*s, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  37.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 32.5k, False: 4.86k]
  |  |  ------------------
  ------------------
  |  Branch (1750:16): [True: 37.4k, False: 784]
  ------------------
 1751|  32.5k|            ++s;
 1752|  32.5k|        }
 1753|  5.65k|        if (!*s) {
  ------------------
  |  Branch (1753:13): [True: 784, False: 4.86k]
  ------------------
 1754|    784|            return 0;
 1755|    784|        }
 1756|  4.86k|        start_token = s;
 1757|       |        /* find end of the token */
 1758|  23.1k|        while (*s && !TEST_CHAR(*s, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  22.7k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  ------------------
  |  Branch (1758:16): [True: 22.7k, False: 390]
  |  Branch (1758:22): [True: 18.2k, False: 4.47k]
  ------------------
 1759|  18.2k|            ++s;
 1760|  18.2k|        }
 1761|  4.86k|        if (!ap_cstr_casecmpn((const char *)start_token, (const char *)tok,
  ------------------
  |  Branch (1761:13): [True: 96, False: 4.77k]
  ------------------
 1762|  4.86k|                         s - start_token)) {
 1763|     96|            return 1;
 1764|     96|        }
 1765|  4.77k|        if (!*s) {
  ------------------
  |  Branch (1765:13): [True: 384, False: 4.38k]
  ------------------
 1766|    384|            return 0;
 1767|    384|        }
 1768|  4.77k|    }
 1769|  1.26k|}
ap_find_last_token:
 1795|  1.26k|{
 1796|  1.26k|    return find_last_token(p, line, tok) != NULL;
 1797|  1.26k|}
ap_is_chunked:
 1800|  1.26k|{
 1801|  1.26k|    const char *s;
 1802|       |
 1803|  1.26k|    if (!line) 
  ------------------
  |  Branch (1803:9): [True: 0, False: 1.26k]
  ------------------
 1804|      0|        return 0;
 1805|  1.26k|    if (!ap_cstr_casecmp(line, "chunked")) { 
  ------------------
  |  Branch (1805:9): [True: 9, False: 1.25k]
  ------------------
 1806|      9|        return 1;
 1807|      9|    }
 1808|       |
 1809|  1.25k|    s = find_last_token(p, line, "chunked");
 1810|       |
 1811|  1.25k|    if (!s) return 0;
  ------------------
  |  Branch (1811:9): [True: 1.22k, False: 28]
  ------------------
 1812|       | 
 1813|       |    /* eat spaces right-to-left to see what precedes "chunked" */
 1814|    348|    while (--s > line) { 
  ------------------
  |  Branch (1814:12): [True: 344, False: 4]
  ------------------
 1815|    344|        if (*s != ' ') break;
  ------------------
  |  Branch (1815:13): [True: 24, False: 320]
  ------------------
 1816|    344|    }
 1817|       |
 1818|       |    /* found delim, or leading ws (input wasn't parsed by httpd as a header) */
 1819|     28|    if (*s == ',' || *s == ' ') { 
  ------------------
  |  Branch (1819:9): [True: 4, False: 24]
  |  Branch (1819:22): [True: 3, False: 21]
  ------------------
 1820|      7|        return 1;
 1821|      7|    }
 1822|     21|    return 0;
 1823|     28|}
ap_escape_shell_cmd:
 1826|  1.26k|{
 1827|  1.26k|    char *cmd;
 1828|  1.26k|    unsigned char *d;
 1829|  1.26k|    const unsigned char *s;
 1830|       |
 1831|  1.26k|    cmd = apr_palloc(p, 2 * strlen(str) + 1);        /* Be safe */
  ------------------
  |  |  425|  1.26k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1832|  1.26k|    d = (unsigned char *)cmd;
 1833|  1.26k|    s = (const unsigned char *)str;
 1834|  56.2k|    for (; *s; ++s) {
  ------------------
  |  Branch (1834:12): [True: 54.9k, False: 1.26k]
  ------------------
 1835|       |
 1836|       |#if defined(OS2) || defined(WIN32)
 1837|       |        /*
 1838|       |         * Newlines to Win32/OS2 CreateProcess() are ill advised.
 1839|       |         * Convert them to spaces since they are effectively white
 1840|       |         * space to most applications
 1841|       |         */
 1842|       |        if (*s == '\r' || *s == '\n') {
 1843|       |             *d++ = ' ';
 1844|       |             continue;
 1845|       |         }
 1846|       |#endif
 1847|       |
 1848|  54.9k|        if (TEST_CHAR(*s, T_ESCAPE_SHELL_CMD)) {
  ------------------
  |  |   53|  54.9k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 17.2k, False: 37.6k]
  |  |  ------------------
  ------------------
 1849|  17.2k|            *d++ = '\\';
 1850|  17.2k|        }
 1851|  54.9k|        *d++ = *s;
 1852|  54.9k|    }
 1853|  1.26k|    *d = '\0';
 1854|       |
 1855|  1.26k|    return cmd;
 1856|  1.26k|}
ap_unescape_url:
 1957|    301|{
 1958|       |    /* Traditional */
 1959|    301|    return unescape_url(url, SLASHES, NULL, 0);
  ------------------
  |  |   88|    301|#define SLASHES "/"
  ------------------
 1960|    301|}
ap_unescape_urlencoded:
 1995|    260|{
 1996|    260|    char *slider;
 1997|       |
 1998|       |    /* replace plus with a space */
 1999|    260|    if (query) {
  ------------------
  |  Branch (1999:9): [True: 260, False: 0]
  ------------------
 2000|  11.3k|        for (slider = query; *slider; slider++) {
  ------------------
  |  Branch (2000:30): [True: 11.0k, False: 260]
  ------------------
 2001|  11.0k|            if (*slider == '+') {
  ------------------
  |  Branch (2001:17): [True: 119, False: 10.9k]
  ------------------
 2002|    119|                *slider = ' ';
 2003|    119|            }
 2004|  11.0k|        }
 2005|    260|    }
 2006|       |
 2007|       |    /* unescape everything else */
 2008|    260|    return unescape_url(query, NULL, NULL, 0);
 2009|    260|}
ap_escape_path_segment_buffer:
 2067|  1.26k|{
 2068|  1.26k|    const unsigned char *s = (const unsigned char *)segment;
 2069|  1.26k|    unsigned char *d = (unsigned char *)copy;
 2070|  1.26k|    unsigned c;
 2071|       |
 2072|  56.2k|    while ((c = *s)) {
  ------------------
  |  Branch (2072:12): [True: 54.9k, False: 1.26k]
  ------------------
 2073|  54.9k|        if (TEST_CHAR(c, T_ESCAPE_PATH_SEGMENT)) {
  ------------------
  |  |   53|  54.9k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 29.3k, False: 25.6k]
  |  |  ------------------
  ------------------
 2074|  29.3k|            d = c2x(c, '%', d);
 2075|  29.3k|        }
 2076|  25.6k|        else {
 2077|  25.6k|            *d++ = c;
 2078|  25.6k|        }
 2079|  54.9k|        ++s;
 2080|  54.9k|    }
 2081|  1.26k|    *d = '\0';
 2082|  1.26k|    return copy;
 2083|  1.26k|}
ap_os_escape_path:
 2091|  1.26k|{
 2092|       |    /* Allocate +3 for potential "./" and trailing NULL.
 2093|       |     * Allocate another +1 to allow the caller to add a trailing '/' (see
 2094|       |     * comment in 'ap_sub_req_lookup_dirent')
 2095|       |     */
 2096|  1.26k|    char *copy = apr_palloc(p, 3 * strlen(path) + 3 + 1);
  ------------------
  |  |  425|  1.26k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2097|  1.26k|    const unsigned char *s = (const unsigned char *)path;
 2098|  1.26k|    unsigned char *d = (unsigned char *)copy;
 2099|  1.26k|    unsigned c;
 2100|       |
 2101|  1.26k|    if (!partial) {
  ------------------
  |  Branch (2101:9): [True: 1.26k, False: 0]
  ------------------
 2102|  1.26k|        const char *colon = ap_strchr_c(path, ':');
  ------------------
  |  | 2504|  1.26k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 2103|  1.26k|        const char *slash = ap_strchr_c(path, '/');
  ------------------
  |  | 2504|  1.26k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 2104|       |
 2105|  1.26k|        if (colon && (!slash || colon < slash)) {
  ------------------
  |  Branch (2105:13): [True: 49, False: 1.21k]
  |  Branch (2105:23): [True: 38, False: 11]
  |  Branch (2105:33): [True: 7, False: 4]
  ------------------
 2106|     45|            *d++ = '.';
 2107|     45|            *d++ = '/';
 2108|     45|        }
 2109|  1.26k|    }
 2110|  56.2k|    while ((c = *s)) {
  ------------------
  |  Branch (2110:12): [True: 54.9k, False: 1.26k]
  ------------------
 2111|  54.9k|        if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) {
  ------------------
  |  |   53|  54.9k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 27.9k, False: 27.0k]
  |  |  ------------------
  ------------------
 2112|  27.9k|            d = c2x(c, '%', d);
 2113|  27.9k|        }
 2114|  27.0k|        else {
 2115|  27.0k|            *d++ = c;
 2116|  27.0k|        }
 2117|  54.9k|        ++s;
 2118|  54.9k|    }
 2119|  1.26k|    *d = '\0';
 2120|  1.26k|    return copy;
 2121|  1.26k|}
ap_escape_urlencoded_buffer:
 2124|  1.26k|{
 2125|  1.26k|    const unsigned char *s = (const unsigned char *)buffer;
 2126|  1.26k|    unsigned char *d = (unsigned char *)copy;
 2127|  1.26k|    unsigned c;
 2128|       |
 2129|  56.2k|    while ((c = *s)) {
  ------------------
  |  Branch (2129:12): [True: 54.9k, False: 1.26k]
  ------------------
 2130|  54.9k|        if (TEST_CHAR(c, T_ESCAPE_URLENCODED)) {
  ------------------
  |  |   53|  54.9k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 33.9k, False: 20.9k]
  |  |  ------------------
  ------------------
 2131|  33.9k|            d = c2x(c, '%', d);
 2132|  33.9k|        }
 2133|  20.9k|        else if (c == ' ') {
  ------------------
  |  Branch (2133:18): [True: 3.60k, False: 17.3k]
  ------------------
 2134|  3.60k|            *d++ = '+';
 2135|  3.60k|        }
 2136|  17.3k|        else {
 2137|  17.3k|            *d++ = c;
 2138|  17.3k|        }
 2139|  54.9k|        ++s;
 2140|  54.9k|    }
 2141|  1.26k|    *d = '\0';
 2142|  1.26k|    return copy;
 2143|  1.26k|}
ap_escape_urlencoded:
 2146|  1.26k|{
 2147|  1.26k|    return ap_escape_urlencoded_buffer(apr_palloc(p, 3 * strlen(buffer) + 1), buffer);
  ------------------
  |  |  425|  1.26k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2148|  1.26k|}
ap_escape_html2:
 2153|  1.26k|{
 2154|  1.26k|    apr_size_t i, j;
 2155|  1.26k|    char *x;
 2156|       |
 2157|       |    /* first, count the number of extra characters */
 2158|  56.2k|    for (i = 0, j = 0; s[i] != '\0'; i++) {
  ------------------
  |  Branch (2158:24): [True: 54.9k, False: 1.26k]
  ------------------
 2159|  54.9k|        if (i + j > APR_SIZE_MAX - 6) {
  ------------------
  |  |  465|  54.9k|#define APR_SIZE_MAX    (~((apr_size_t)0))
  ------------------
  |  Branch (2159:13): [True: 0, False: 54.9k]
  ------------------
 2160|      0|            abort();
 2161|      0|        }
 2162|  54.9k|        if (s[i] == '<' || s[i] == '>')
  ------------------
  |  Branch (2162:13): [True: 266, False: 54.6k]
  |  Branch (2162:28): [True: 408, False: 54.2k]
  ------------------
 2163|    674|            j += 3;
 2164|  54.2k|        else if (s[i] == '&')
  ------------------
  |  Branch (2164:18): [True: 402, False: 53.8k]
  ------------------
 2165|    402|            j += 4;
 2166|  53.8k|        else if (s[i] == '"')
  ------------------
  |  Branch (2166:18): [True: 1.47k, False: 52.3k]
  ------------------
 2167|  1.47k|            j += 5;
 2168|  52.3k|        else if (toasc && !apr_isascii(s[i]))
  ------------------
  |  |  216|      0|#define apr_isascii(c) (isascii(((unsigned char)(c))))
  ------------------
  |  Branch (2168:18): [True: 0, False: 52.3k]
  |  Branch (2168:27): [True: 0, False: 0]
  ------------------
 2169|      0|            j += 5;
 2170|  54.9k|    }
 2171|       |
 2172|  1.26k|    if (j == 0)
  ------------------
  |  Branch (2172:9): [True: 935, False: 329]
  ------------------
 2173|    935|        return apr_pstrmemdup(p, s, i);
 2174|       |
 2175|    329|    x = apr_palloc(p, i + j + 1);
  ------------------
  |  |  425|    329|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    329|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    329|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    329|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2176|  18.7k|    for (i = 0, j = 0; s[i] != '\0'; i++, j++)
  ------------------
  |  Branch (2176:24): [True: 18.4k, False: 329]
  ------------------
 2177|  18.4k|        if (s[i] == '<') {
  ------------------
  |  Branch (2177:13): [True: 266, False: 18.1k]
  ------------------
 2178|    266|            memcpy(&x[j], "&lt;", 4);
 2179|    266|            j += 3;
 2180|    266|        }
 2181|  18.1k|        else if (s[i] == '>') {
  ------------------
  |  Branch (2181:18): [True: 408, False: 17.7k]
  ------------------
 2182|    408|            memcpy(&x[j], "&gt;", 4);
 2183|    408|            j += 3;
 2184|    408|        }
 2185|  17.7k|        else if (s[i] == '&') {
  ------------------
  |  Branch (2185:18): [True: 402, False: 17.3k]
  ------------------
 2186|    402|            memcpy(&x[j], "&amp;", 5);
 2187|    402|            j += 4;
 2188|    402|        }
 2189|  17.3k|        else if (s[i] == '"') {
  ------------------
  |  Branch (2189:18): [True: 1.47k, False: 15.8k]
  ------------------
 2190|  1.47k|            memcpy(&x[j], "&quot;", 6);
 2191|  1.47k|            j += 5;
 2192|  1.47k|        }
 2193|  15.8k|        else if (toasc && !apr_isascii(s[i])) {
  ------------------
  |  |  216|      0|#define apr_isascii(c) (isascii(((unsigned char)(c))))
  ------------------
  |  Branch (2193:18): [True: 0, False: 15.8k]
  |  Branch (2193:27): [True: 0, False: 0]
  ------------------
 2194|      0|            char *esc = apr_psprintf(p, "&#%3.3d;", (unsigned char)s[i]);
 2195|      0|            memcpy(&x[j], esc, 6);
 2196|      0|            j += 5;
 2197|      0|        }
 2198|  15.8k|        else
 2199|  15.8k|            x[j] = s[i];
 2200|       |
 2201|    329|    x[j] = '\0';
 2202|    329|    return x;
 2203|  1.26k|}
ap_escape_logitem:
 2205|  1.26k|{
 2206|  1.26k|    char *ret;
 2207|  1.26k|    unsigned char *d;
 2208|  1.26k|    const unsigned char *s;
 2209|  1.26k|    apr_size_t length, escapes = 0;
 2210|       |
 2211|  1.26k|    if (!str) {
  ------------------
  |  Branch (2211:9): [True: 0, False: 1.26k]
  ------------------
 2212|      0|        return NULL;
 2213|      0|    }
 2214|       |
 2215|       |    /* Compute how many characters need to be escaped */
 2216|  1.26k|    s = (const unsigned char *)str;
 2217|  56.2k|    for (; *s; ++s) {
  ------------------
  |  Branch (2217:12): [True: 54.9k, False: 1.26k]
  ------------------
 2218|  54.9k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  54.9k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 21.9k, False: 32.9k]
  |  |  ------------------
  ------------------
 2219|  21.9k|            escapes++;
 2220|  21.9k|        }
 2221|  54.9k|    }
 2222|       |    
 2223|       |    /* Compute the length of the input string, including NULL */
 2224|  1.26k|    length = s - (const unsigned char *)str + 1;
 2225|       |    
 2226|       |    /* Fast path: nothing to escape */
 2227|  1.26k|    if (escapes == 0) {
  ------------------
  |  Branch (2227:9): [True: 243, False: 1.02k]
  ------------------
 2228|    243|        return apr_pmemdup(p, str, length);
 2229|    243|    }
 2230|       |    
 2231|       |    /* Each escaped character needs up to 3 extra bytes (0 --> \x00) */
 2232|  1.02k|    ret = apr_palloc(p, length + 3 * escapes);
  ------------------
  |  |  425|  1.02k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.02k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.02k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.02k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|  1.02k|    d = (unsigned char *)ret;
 2234|  1.02k|    s = (const unsigned char *)str;
 2235|  50.6k|    for (; *s; ++s) {
  ------------------
  |  Branch (2235:12): [True: 49.6k, False: 1.02k]
  ------------------
 2236|  49.6k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  49.6k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 21.9k, False: 27.6k]
  |  |  ------------------
  ------------------
 2237|  21.9k|            *d++ = '\\';
 2238|  21.9k|            switch(*s) {
 2239|    296|            case '\b':
  ------------------
  |  Branch (2239:13): [True: 296, False: 21.7k]
  ------------------
 2240|    296|                *d++ = 'b';
 2241|    296|                break;
 2242|  2.70k|            case '\n':
  ------------------
  |  Branch (2242:13): [True: 2.70k, False: 19.2k]
  ------------------
 2243|  2.70k|                *d++ = 'n';
 2244|  2.70k|                break;
 2245|    438|            case '\r':
  ------------------
  |  Branch (2245:13): [True: 438, False: 21.5k]
  ------------------
 2246|    438|                *d++ = 'r';
 2247|    438|                break;
 2248|  1.56k|            case '\t':
  ------------------
  |  Branch (2248:13): [True: 1.56k, False: 20.4k]
  ------------------
 2249|  1.56k|                *d++ = 't';
 2250|  1.56k|                break;
 2251|    392|            case '\v':
  ------------------
  |  Branch (2251:13): [True: 392, False: 21.6k]
  ------------------
 2252|    392|                *d++ = 'v';
 2253|    392|                break;
 2254|  5.20k|            case '\\':
  ------------------
  |  Branch (2254:13): [True: 5.20k, False: 16.7k]
  ------------------
 2255|  6.67k|            case '"':
  ------------------
  |  Branch (2255:13): [True: 1.47k, False: 20.5k]
  ------------------
 2256|  6.67k|                *d++ = *s;
 2257|  6.67k|                break;
 2258|  9.92k|            default:
  ------------------
  |  Branch (2258:13): [True: 9.92k, False: 12.0k]
  ------------------
 2259|  9.92k|                c2x(*s, 'x', d);
 2260|  9.92k|                d += 3;
 2261|  21.9k|            }
 2262|  21.9k|        }
 2263|  27.6k|        else {
 2264|  27.6k|            *d++ = *s;
 2265|  27.6k|        }
 2266|  49.6k|    }
 2267|  1.02k|    *d = '\0';
 2268|       |
 2269|  1.02k|    return ret;
 2270|  1.02k|}
ap_escape_errorlog_item:
 2274|  1.26k|{
 2275|  1.26k|    unsigned char *d, *ep;
 2276|  1.26k|    const unsigned char *s;
 2277|       |
 2278|  1.26k|    if (!source || !buflen) { /* be safe */
  ------------------
  |  Branch (2278:9): [True: 0, False: 1.26k]
  |  Branch (2278:20): [True: 0, False: 1.26k]
  ------------------
 2279|      0|        return 0;
 2280|      0|    }
 2281|       |
 2282|  1.26k|    d = (unsigned char *)dest;
 2283|  1.26k|    s = (const unsigned char *)source;
 2284|  1.26k|    ep = d + buflen - 1;
 2285|       |
 2286|  56.2k|    for (; d < ep && *s; ++s) {
  ------------------
  |  Branch (2286:12): [True: 56.1k, False: 27]
  |  Branch (2286:22): [True: 54.9k, False: 1.23k]
  ------------------
 2287|       |
 2288|  54.9k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  54.9k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 21.9k, False: 32.9k]
  |  |  ------------------
  ------------------
 2289|  21.9k|            *d++ = '\\';
 2290|  21.9k|            if (d >= ep) {
  ------------------
  |  Branch (2290:17): [True: 0, False: 21.9k]
  ------------------
 2291|      0|                --d;
 2292|      0|                break;
 2293|      0|            }
 2294|       |
 2295|  21.9k|            switch(*s) {
 2296|    296|            case '\b':
  ------------------
  |  Branch (2296:13): [True: 296, False: 21.7k]
  ------------------
 2297|    296|                *d++ = 'b';
 2298|    296|                break;
 2299|  2.70k|            case '\n':
  ------------------
  |  Branch (2299:13): [True: 2.70k, False: 19.2k]
  ------------------
 2300|  2.70k|                *d++ = 'n';
 2301|  2.70k|                break;
 2302|    438|            case '\r':
  ------------------
  |  Branch (2302:13): [True: 438, False: 21.5k]
  ------------------
 2303|    438|                *d++ = 'r';
 2304|    438|                break;
 2305|  1.56k|            case '\t':
  ------------------
  |  Branch (2305:13): [True: 1.56k, False: 20.4k]
  ------------------
 2306|  1.56k|                *d++ = 't';
 2307|  1.56k|                break;
 2308|    392|            case '\v':
  ------------------
  |  Branch (2308:13): [True: 392, False: 21.6k]
  ------------------
 2309|    392|                *d++ = 'v';
 2310|    392|                break;
 2311|  5.20k|            case '\\':
  ------------------
  |  Branch (2311:13): [True: 5.20k, False: 16.7k]
  ------------------
 2312|  5.20k|                *d++ = *s;
 2313|  5.20k|                break;
 2314|  1.47k|            case '"': /* no need for this in error log */
  ------------------
  |  Branch (2314:13): [True: 1.47k, False: 20.5k]
  ------------------
 2315|  1.47k|                d[-1] = *s;
 2316|  1.47k|                break;
 2317|  9.92k|            default:
  ------------------
  |  Branch (2317:13): [True: 9.92k, False: 12.0k]
  ------------------
 2318|  9.92k|                if (d >= ep - 2) {
  ------------------
  |  Branch (2318:21): [True: 0, False: 9.92k]
  ------------------
 2319|      0|                    ep = --d; /* break the for loop as well */
 2320|      0|                    break;
 2321|      0|                }
 2322|  9.92k|                c2x(*s, 'x', d);
 2323|  9.92k|                d += 3;
 2324|  21.9k|            }
 2325|  21.9k|        }
 2326|  32.9k|        else {
 2327|  32.9k|            *d++ = *s;
 2328|  32.9k|        }
 2329|  54.9k|    }
 2330|  1.26k|    *d = '\0';
 2331|       |
 2332|  1.26k|    return (d - (unsigned char *)dest);
 2333|  1.26k|}
ap_str_tolower:
 2432|    224|{
 2433|  9.21k|    while (*str) {
  ------------------
  |  Branch (2433:12): [True: 8.98k, False: 224]
  ------------------
 2434|  8.98k|        *str = apr_tolower(*str);
  ------------------
  |  |  231|  8.98k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
 2435|  8.98k|        ++str;
 2436|  8.98k|    }
 2437|    224|}
ap_pbase64decode:
 2499|  1.26k|{
 2500|  1.26k|    char *decoded;
 2501|       |
 2502|  1.26k|    decoded = (char *) apr_palloc(p, apr_base64_decode_len(bufcoded));
  ------------------
  |  |  425|  1.26k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|  1.26k|    apr_base64_decode(decoded, bufcoded);
 2504|       |
 2505|  1.26k|    return decoded;
 2506|  1.26k|}
ap_pbase64decode_strict:
 2513|    202|{
 2514|    202|    apr_size_t end_index;
 2515|    202|    int last_group_len;
 2516|    202|    const char *end;
 2517|       |
 2518|       |    /* Sanity check.
 2519|       |     * TODO: this would be a lot more efficient if we had access to the lookup
 2520|       |     * table used by APR. If that gets pulled in at any point, make use of it.
 2521|       |     */
 2522|    202|    end_index = strspn(encoded, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 2523|    202|                                "abcdefghijklmnopqrstuvwxyz"
 2524|    202|                                "0123456789+/");
 2525|       |
 2526|    202|    last_group_len = end_index % 4;
 2527|    202|    end = encoded + end_index;
 2528|       |
 2529|       |    /* The only non-alphabet character allowed is the padding character '=' at
 2530|       |     * the end of the string. There are two allowable padding cases for the last
 2531|       |     * group of four: "xY==" or "xyZ=". We require the final (non-padding)
 2532|       |     * character to have been zero-padded during encoding, which limits the
 2533|       |     * character choices.
 2534|       |     */
 2535|    202|    if (last_group_len == 1) {
  ------------------
  |  Branch (2535:9): [True: 13, False: 189]
  ------------------
 2536|       |        /* This isn't ever valid. */
 2537|     13|        return APR_EINVAL;
  ------------------
  |  |  715|     13|#define APR_EINVAL EINVAL
  ------------------
 2538|     13|    }
 2539|    189|    else if (last_group_len == 2) {
  ------------------
  |  Branch (2539:14): [True: 27, False: 162]
  ------------------
 2540|       |        /* ...xY== */
 2541|     27|        if (*end != '=' || end[1] != '=') {
  ------------------
  |  Branch (2541:13): [True: 13, False: 14]
  |  Branch (2541:28): [True: 10, False: 4]
  ------------------
 2542|     23|            return APR_EINVAL;
  ------------------
  |  |  715|     23|#define APR_EINVAL EINVAL
  ------------------
 2543|     23|        }
 2544|      4|        else if (!ap_strchr("AQgw", end[-1])) {
  ------------------
  |  | 2502|      4|# define ap_strchr(s, c)     strchr(s, c)
  ------------------
  |  Branch (2544:18): [True: 1, False: 3]
  ------------------
 2545|       |            /* Correctly zero-padded input data will result in a final character
 2546|       |             * that is one of the four above. */
 2547|      1|            return APR_EINVAL;
  ------------------
  |  |  715|      1|#define APR_EINVAL EINVAL
  ------------------
 2548|      1|        }
 2549|       |
 2550|      3|        end += 2;
 2551|      3|    }
 2552|    162|    else if (last_group_len == 3) {
  ------------------
  |  Branch (2552:14): [True: 6, False: 156]
  ------------------
 2553|       |        /* ...xyZ= */
 2554|      6|        if (*end != '=') {
  ------------------
  |  Branch (2554:13): [True: 2, False: 4]
  ------------------
 2555|      2|            return APR_EINVAL;
  ------------------
  |  |  715|      2|#define APR_EINVAL EINVAL
  ------------------
 2556|      2|        }
 2557|      4|        else if (!ap_strchr("AEIMQUYcgkosw048", end[-1])) {
  ------------------
  |  | 2502|      4|# define ap_strchr(s, c)     strchr(s, c)
  ------------------
  |  Branch (2557:18): [True: 1, False: 3]
  ------------------
 2558|       |            /* Correctly zero-padded input data will result in a final character
 2559|       |             * that is one of the sixteen above. */
 2560|      1|            return APR_EINVAL;
  ------------------
  |  |  715|      1|#define APR_EINVAL EINVAL
  ------------------
 2561|      1|        }
 2562|       |
 2563|      3|        end++;
 2564|      3|    }
 2565|       |
 2566|       |    /* At this point, if the encoded buffer is correct, we should be at the end
 2567|       |     * of the string. */
 2568|    162|    if (*end) {
  ------------------
  |  Branch (2568:9): [True: 127, False: 35]
  ------------------
 2569|    127|        return APR_EINVAL;
  ------------------
  |  |  715|    127|#define APR_EINVAL EINVAL
  ------------------
 2570|    127|    }
 2571|       |
 2572|     35|    *decoded = apr_palloc(p, apr_base64_decode_len(encoded));
  ------------------
  |  |  425|     35|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     35|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|     35|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|     35|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2573|     35|    *len = apr_base64_decode(*decoded, encoded);
 2574|       |
 2575|     35|    return APR_SUCCESS;
  ------------------
  |  |  225|     35|#define APR_SUCCESS 0
  ------------------
 2576|    162|}
ap_pbase64encode:
 2579|  1.26k|{
 2580|  1.26k|    char *encoded;
 2581|  1.26k|    int l = strlen(string);
 2582|       |
 2583|  1.26k|    encoded = (char *) apr_palloc(p, apr_base64_encode_len(l));
  ------------------
  |  |  425|  1.26k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2584|  1.26k|    apr_base64_encode(encoded, string, l);
 2585|       |
 2586|  1.26k|    return encoded;
 2587|  1.26k|}
ap_content_type_tolower:
 2597|    224|{
 2598|    224|    char *semi;
 2599|       |
 2600|    224|    semi = strchr(str, ';');
 2601|    224|    if (semi) {
  ------------------
  |  Branch (2601:9): [True: 7, False: 217]
  ------------------
 2602|      7|        *semi = '\0';
 2603|      7|    }
 2604|       |
 2605|    224|    ap_str_tolower(str);
 2606|       |
 2607|    224|    if (semi) {
  ------------------
  |  Branch (2607:9): [True: 7, False: 217]
  ------------------
 2608|      7|        *semi = ';';
 2609|      7|    }
 2610|    224|}
ap_escape_quotes:
 2616|  1.26k|{
 2617|  1.26k|    apr_size_t size, extra = 0;
 2618|  1.26k|    const char *inchr = instring;
 2619|  1.26k|    char *outchr, *outstring;
 2620|       |
 2621|       |    /*
 2622|       |     * Look through the input string, jogging the length of the output
 2623|       |     * string up by an extra byte each time we find an unescaped ".
 2624|       |     */
 2625|  52.8k|    while (*inchr != '\0') {
  ------------------
  |  Branch (2625:12): [True: 51.5k, False: 1.26k]
  ------------------
 2626|  51.5k|        if (*inchr == '"') {
  ------------------
  |  Branch (2626:13): [True: 1.45k, False: 50.1k]
  ------------------
 2627|  1.45k|            extra++;
 2628|  1.45k|        }
 2629|       |        /*
 2630|       |         * If we find a slosh, and it's not the last byte in the string,
 2631|       |         * it's escaping something - advance past both bytes.
 2632|       |         */
 2633|  50.1k|        else if ((*inchr == '\\') && (inchr[1] != '\0')) {
  ------------------
  |  Branch (2633:18): [True: 3.38k, False: 46.7k]
  |  Branch (2633:38): [True: 3.34k, False: 44]
  ------------------
 2634|  3.34k|            inchr++;
 2635|  3.34k|        }
 2636|  51.5k|        inchr++;
 2637|  51.5k|    }
 2638|       |
 2639|  1.26k|    if (!extra) {
  ------------------
  |  Branch (2639:9): [True: 1.02k, False: 242]
  ------------------
 2640|  1.02k|        return apr_pstrdup(p, instring);
 2641|  1.02k|    }
 2642|       |
 2643|       |    /* How large will the string become, once we escaped all the quotes?
 2644|       |     * The tricky cases are
 2645|       |     * - an `instring` that is already longer than `ptrdiff_t`
 2646|       |     *   can hold (which is an undefined case in C, as C defines ptrdiff_t as
 2647|       |     *   a signed difference between pointers into the same array and one index
 2648|       |     *   beyond).
 2649|       |     * - an `instring` that, including the `extra` chars we want to add, becomes
 2650|       |     *   even larger than apr_size_t can handle.
 2651|       |     * Since this function was not designed to ever return NULL for failure, we
 2652|       |     * can only trigger a hard assertion failure. It seems more a programming
 2653|       |     * mistake (or failure to verify the input causing this) that leads to this
 2654|       |     * situation.
 2655|       |     */
 2656|    242|    ap_assert(inchr - instring > 0);
  ------------------
  |  | 2405|    242|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2405:25): [True: 242, False: 0]
  |  |  ------------------
  ------------------
 2657|      0|    size = ((apr_size_t)(inchr - instring)) + 1;
 2658|    242|    ap_assert(size + extra > size);
  ------------------
  |  | 2405|    242|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2405:25): [True: 242, False: 0]
  |  |  ------------------
  ------------------
 2659|       |
 2660|    242|    outstring = apr_palloc(p, size + extra);
  ------------------
  |  |  425|    242|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    242|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    242|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    242|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2661|    242|    inchr = instring;
 2662|    242|    outchr = outstring;
 2663|       |    /*
 2664|       |     * Now copy the input string to the output string, inserting a slosh
 2665|       |     * in front of every " that doesn't already have one.
 2666|       |     */
 2667|  13.6k|    while (*inchr != '\0') {
  ------------------
  |  Branch (2667:12): [True: 13.4k, False: 242]
  ------------------
 2668|  13.4k|        if (*inchr == '"') {
  ------------------
  |  Branch (2668:13): [True: 1.45k, False: 11.9k]
  ------------------
 2669|  1.45k|            *outchr++ = '\\';
 2670|  1.45k|        }
 2671|  11.9k|        else if ((*inchr == '\\') && (inchr[1] != '\0')) {
  ------------------
  |  Branch (2671:18): [True: 720, False: 11.2k]
  |  Branch (2671:38): [True: 705, False: 15]
  ------------------
 2672|    705|            *outchr++ = *inchr++;
 2673|    705|        }
 2674|  13.4k|        *outchr++ = *inchr++;
 2675|  13.4k|    }
 2676|    242|    *outchr = '\0';
 2677|    242|    return outstring;
 2678|  1.26k|}
ap_timeout_parameter_parse:
 2717|  1.26k|{
 2718|  1.26k|    char *endp;
 2719|  1.26k|    const char *time_str;
 2720|  1.26k|    apr_int64_t tout;
 2721|  1.26k|    apr_uint64_t check;
 2722|       |
 2723|  1.26k|    tout = apr_strtoi64(timeout_parameter, &endp, 10);
 2724|  1.26k|    if (errno) {
 2725|      4|        return errno;
 2726|      4|    }
 2727|  1.26k|    if (!endp || !*endp) {
  ------------------
  |  Branch (2727:9): [True: 0, False: 1.26k]
  |  Branch (2727:18): [True: 129, False: 1.13k]
  ------------------
 2728|    129|        time_str = default_time_unit;
 2729|    129|    }
 2730|  1.13k|    else {
 2731|  1.13k|        time_str = endp;
 2732|  1.13k|    }
 2733|       |
 2734|  1.26k|    if (tout < 0) { 
  ------------------
  |  Branch (2734:9): [True: 84, False: 1.17k]
  ------------------
 2735|     84|        return APR_EGENERAL;
  ------------------
  |  |  313|     84|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|     84|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2736|     84|    }
 2737|       |
 2738|  1.17k|    switch (*time_str) {
 2739|       |        /* Time is in seconds */
 2740|     74|    case 's':
  ------------------
  |  Branch (2740:5): [True: 74, False: 1.10k]
  ------------------
 2741|    101|    case 'S':
  ------------------
  |  Branch (2741:5): [True: 27, False: 1.14k]
  ------------------
 2742|    101|        CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX));
  ------------------
  |  | 2712|    101|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     41|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     41|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2712:34): [True: 41, False: 60]
  |  |  ------------------
  ------------------
 2743|     60|        check = apr_time_from_sec(tout);
  ------------------
  |  |   78|     60|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     60|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     60|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  390|     60| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2744|     60|        break;
 2745|       |        /* Time is in hours */
 2746|     76|    case 'h':
  ------------------
  |  Branch (2746:5): [True: 76, False: 1.10k]
  ------------------
 2747|     94|    case 'H':
  ------------------
  |  Branch (2747:5): [True: 18, False: 1.15k]
  ------------------
 2748|     94|        CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX / 3600));
  ------------------
  |  | 2712|     94|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     49|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     49|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2712:34): [True: 49, False: 45]
  |  |  ------------------
  ------------------
 2749|     45|        check = apr_time_from_sec(tout * 3600);
  ------------------
  |  |   78|     45|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     45|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     45|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  390|     45| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2750|     45|        break;
 2751|    129|    case 'm':
  ------------------
  |  Branch (2751:5): [True: 129, False: 1.04k]
  ------------------
 2752|    226|    case 'M':
  ------------------
  |  Branch (2752:5): [True: 97, False: 1.07k]
  ------------------
 2753|    226|        switch (*(++time_str)) {
 2754|       |        /* Time is in milliseconds */
 2755|    122|        case 's':
  ------------------
  |  Branch (2755:9): [True: 122, False: 104]
  ------------------
 2756|    127|        case 'S':
  ------------------
  |  Branch (2756:9): [True: 5, False: 221]
  ------------------
 2757|    127|            CHECK_OVERFLOW(tout, apr_time_as_msec(APR_INT64_MAX));
  ------------------
  |  | 2712|    127|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     35|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     35|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2712:34): [True: 35, False: 92]
  |  |  ------------------
  ------------------
 2758|     92|            check = apr_time_from_msec(tout);
  ------------------
  |  |   75|     92|#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
  ------------------
 2759|     92|            break;
 2760|       |        /* Time is in minutes */
 2761|     71|        case 'i':
  ------------------
  |  Branch (2761:9): [True: 71, False: 155]
  ------------------
 2762|     96|        case 'I':
  ------------------
  |  Branch (2762:9): [True: 25, False: 201]
  ------------------
 2763|     96|            CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX / 60));
  ------------------
  |  | 2712|     96|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     45|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     45|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2712:34): [True: 45, False: 51]
  |  |  ------------------
  ------------------
 2764|     51|            check = apr_time_from_sec(tout * 60);
  ------------------
  |  |   78|     51|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     51|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     51|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  390|     51| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2765|     51|            break;
 2766|      3|        default:
  ------------------
  |  Branch (2766:9): [True: 3, False: 223]
  ------------------
 2767|      3|            return APR_EGENERAL;
  ------------------
  |  |  313|      3|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|      3|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2768|    226|        }
 2769|    143|        break;
 2770|    755|    default:
  ------------------
  |  Branch (2770:5): [True: 755, False: 421]
  ------------------
 2771|    755|        return APR_EGENERAL;
  ------------------
  |  |  313|    755|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|    755|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2772|  1.17k|    }
 2773|       |
 2774|    248|    *timeout = (apr_interval_time_t)check;
 2775|    248|    return APR_SUCCESS;
  ------------------
  |  |  225|    248|#define APR_SUCCESS 0
  ------------------
 2776|  1.17k|}
ap_str2_alnum:
 2828|  1.26k|AP_DECLARE(apr_status_t) ap_str2_alnum(const char *src, char *dest) {
 2829|       |
 2830|  56.2k|    for ( ; *src; src++, dest++)
  ------------------
  |  Branch (2830:13): [True: 54.9k, False: 1.26k]
  ------------------
 2831|  54.9k|    {
 2832|  54.9k|        if (!apr_isprint(*src))
  ------------------
  |  |  221|  54.9k|#define apr_isprint(c) (isprint(((unsigned char)(c))))
  ------------------
  |  Branch (2832:13): [True: 15.3k, False: 39.6k]
  ------------------
 2833|  15.3k|            *dest = 'x';
 2834|  39.6k|        else if (!apr_isalnum(*src))
  ------------------
  |  |  203|  39.6k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  ------------------
  |  Branch (2834:18): [True: 24.7k, False: 14.9k]
  ------------------
 2835|  24.7k|            *dest = '_';
 2836|  14.9k|        else
 2837|  14.9k|            *dest = (char)*src;
 2838|  54.9k|    }
 2839|  1.26k|    *dest = '\0';
 2840|  1.26k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
 2841|       |
 2842|  1.26k|}
ap_pstr2_alnum:
 2846|  1.26k|{
 2847|  1.26k|    char *new = apr_palloc(p, strlen(src)+1);
  ------------------
  |  |  425|  1.26k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2848|  1.26k|    if (!new)
  ------------------
  |  Branch (2848:9): [True: 0, False: 1.26k]
  ------------------
 2849|      0|        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2850|  1.26k|    *dest = new;
 2851|  1.26k|    return ap_str2_alnum(src, new);
 2852|  1.26k|}
ap_cstr_casecmp:
 3707|  2.52k|{
 3708|  2.52k|    const unsigned char *u1 = (const unsigned char *)s1;
 3709|  2.52k|    const unsigned char *u2 = (const unsigned char *)s2;
 3710|  3.17k|    for (;;) {
 3711|  3.17k|        const int c2 = ucharmap[*u2++];
 3712|  3.17k|        const int cmp = (int)ucharmap[*u1++] - c2;
 3713|       |        /* Not necessary to test for !c1, this is caught by cmp */
 3714|  3.17k|        if (cmp || !c2)
  ------------------
  |  Branch (3714:13): [True: 2.50k, False: 664]
  |  Branch (3714:20): [True: 20, False: 644]
  ------------------
 3715|  2.52k|            return cmp;
 3716|  3.17k|    }
 3717|  2.52k|}
ap_cstr_casecmpn:
 3720|  6.53k|{
 3721|  6.53k|    const unsigned char *u1 = (const unsigned char *)s1;
 3722|  6.53k|    const unsigned char *u2 = (const unsigned char *)s2;
 3723|  9.09k|    while (n--) {
  ------------------
  |  Branch (3723:12): [True: 8.96k, False: 135]
  ------------------
 3724|  8.96k|        const int c2 = ucharmap[*u2++];
 3725|  8.96k|        const int cmp = (int)ucharmap[*u1++] - c2;
 3726|       |        /* Not necessary to test for !c1, this is caught by cmp */
 3727|  8.96k|        if (cmp || !c2)
  ------------------
  |  Branch (3727:13): [True: 6.40k, False: 2.55k]
  |  Branch (3727:20): [True: 0, False: 2.55k]
  ------------------
 3728|  6.40k|            return cmp;
 3729|  8.96k|    }
 3730|    135|    return 0;
 3731|  6.53k|}
util.c:substring_conf:
  820|  1.24k|{
  821|  1.24k|    char *result = apr_palloc(p, len + 1);
  ------------------
  |  |  425|  1.24k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.24k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.24k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.24k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  822|  1.24k|    char *resp = result;
  823|  1.24k|    int i;
  824|       |
  825|  33.3k|    for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (825:17): [True: 32.1k, False: 1.24k]
  ------------------
  826|  32.1k|        if (start[i] == '\\' && (start[i + 1] == '\\'
  ------------------
  |  Branch (826:13): [True: 1.73k, False: 30.3k]
  |  Branch (826:34): [True: 868, False: 869]
  ------------------
  827|  1.73k|                                 || (quote && start[i + 1] == quote)))
  ------------------
  |  Branch (827:38): [True: 310, False: 559]
  |  Branch (827:47): [True: 119, False: 191]
  ------------------
  828|    987|            *resp++ = start[++i];
  829|  31.1k|        else
  830|  31.1k|            *resp++ = start[i];
  831|  32.1k|    }
  832|       |
  833|  1.24k|    *resp++ = '\0';
  834|       |#if RESOLVE_ENV_PER_TOKEN
  835|       |    return (char *)ap_resolve_env(p,result);
  836|       |#else
  837|  1.24k|    return result;
  838|  1.24k|#endif
  839|  1.24k|}
util.c:cfg_getch:
  960|  15.7k|{
  961|  15.7k|    return apr_file_getc(ch, param);
  962|  15.7k|}
util.c:cfg_getstr:
  965|   772k|{
  966|   772k|    return apr_file_gets(buf, bufsiz, param);
  967|   772k|}
util.c:ap_cfg_getline_core:
 1094|  1.26k|{
 1095|  1.26k|    apr_status_t rc;
 1096|       |    /* If a "get string" function is defined, use it */
 1097|  1.26k|    if (cfp->getstr != NULL) {
  ------------------
  |  Branch (1097:9): [True: 1.16k, False: 104]
  ------------------
 1098|  1.16k|        char *cp;
 1099|  1.16k|        char *cbuf = buf + offset;
 1100|  1.16k|        apr_size_t cbufsize = bufsize - offset;
 1101|       |
 1102|   772k|        while (1) {
  ------------------
  |  Branch (1102:16): [Folded - Ignored]
  ------------------
 1103|   772k|            ++cfp->line_number;
 1104|   772k|            rc = cfp->getstr(cbuf, cbufsize, cfp->param);
 1105|   772k|            if (rc == APR_EOF) {
  ------------------
  |  |  467|   772k|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|   772k|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|   772k|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|   772k|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1105:17): [True: 15, False: 772k]
  ------------------
 1106|     15|                if (cbuf != buf + offset) {
  ------------------
  |  Branch (1106:21): [True: 12, False: 3]
  ------------------
 1107|     12|                    *cbuf = '\0';
 1108|     12|                    break;
 1109|     12|                }
 1110|      3|                else {
 1111|      3|                    return APR_EOF;
  ------------------
  |  |  467|      3|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      3|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      3|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      3|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|      3|                }
 1113|     15|            }
 1114|   772k|            if (rc != APR_SUCCESS) {
  ------------------
  |  |  225|   772k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1114:17): [True: 0, False: 772k]
  ------------------
 1115|      0|                return rc;
 1116|      0|            }
 1117|       |
 1118|       |            /*
 1119|       |             *  check for line continuation,
 1120|       |             *  i.e. match [^\\]\\[\r]\n only
 1121|       |             */
 1122|   772k|            cp = cbuf;
 1123|   772k|            cp += strlen(cp);
 1124|   772k|            if (cp > buf && cp[-1] == LF) {
  ------------------
  |  |  730|   772k|#define LF 10
  ------------------
  |  Branch (1124:17): [True: 772k, False: 14]
  |  Branch (1124:29): [True: 771k, False: 939]
  ------------------
 1125|   771k|                cp--;
 1126|   771k|                if (cp > buf && cp[-1] == CR)
  ------------------
  |  |  732|   771k|#define CR 13
  ------------------
  |  Branch (1126:21): [True: 771k, False: 16]
  |  Branch (1126:33): [True: 243, False: 771k]
  ------------------
 1127|    243|                    cp--;
 1128|   771k|                if (cp > buf && cp[-1] == '\\') {
  ------------------
  |  Branch (1128:21): [True: 771k, False: 18]
  |  Branch (1128:33): [True: 771k, False: 174]
  ------------------
 1129|   771k|                    cp--;
 1130|       |                    /*
 1131|       |                     * line continuation requested -
 1132|       |                     * then remove backslash and continue
 1133|       |                     */
 1134|   771k|                    cbufsize -= (cp-cbuf);
 1135|   771k|                    cbuf = cp;
 1136|   771k|                    continue;
 1137|   771k|                }
 1138|   771k|            }
 1139|    953|            else if (cp - buf >= bufsize - 1) {
  ------------------
  |  Branch (1139:22): [True: 147, False: 806]
  ------------------
 1140|    147|                return APR_ENOSPC;
  ------------------
  |  |  680|    147|#define APR_ENOSPC ENOSPC
  ------------------
 1141|    147|            }
 1142|    998|            break;
 1143|   772k|        }
 1144|  1.16k|    } else {
 1145|       |        /* No "get string" function defined; read character by character */
 1146|    104|        apr_size_t i = offset;
 1147|       |
 1148|    104|        if (bufsize < 2) {
  ------------------
  |  Branch (1148:13): [True: 0, False: 104]
  ------------------
 1149|       |            /* too small, assume caller is crazy */
 1150|      0|            return APR_EINVAL;
  ------------------
  |  |  715|      0|#define APR_EINVAL EINVAL
  ------------------
 1151|      0|        }
 1152|    104|        buf[offset] = '\0';
 1153|       |
 1154|  15.7k|        while (1) {
  ------------------
  |  Branch (1154:16): [Folded - Ignored]
  ------------------
 1155|  15.7k|            char c;
 1156|  15.7k|            rc = cfp->getch(&c, cfp->param);
 1157|  15.7k|            if (rc == APR_EOF) {
  ------------------
  |  |  467|  15.7k|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|  15.7k|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|  15.7k|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  15.7k|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1157:17): [True: 15, False: 15.7k]
  ------------------
 1158|     15|                if (i > offset)
  ------------------
  |  Branch (1158:21): [True: 15, False: 0]
  ------------------
 1159|     15|                    break;
 1160|      0|                else
 1161|      0|                    return APR_EOF;
  ------------------
  |  |  467|      0|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1162|     15|            }
 1163|  15.7k|            if (rc != APR_SUCCESS)
  ------------------
  |  |  225|  15.7k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1163:17): [True: 0, False: 15.7k]
  ------------------
 1164|      0|                return rc;
 1165|  15.7k|            if (c == LF) {
  ------------------
  |  |  730|  15.7k|#define LF 10
  ------------------
  |  Branch (1165:17): [True: 4.63k, False: 11.1k]
  ------------------
 1166|  4.63k|                ++cfp->line_number;
 1167|       |                /* check for line continuation */
 1168|  4.63k|                if (i > 0 && buf[i-1] == '\\') {
  ------------------
  |  Branch (1168:21): [True: 4.63k, False: 2]
  |  Branch (1168:30): [True: 4.59k, False: 38]
  ------------------
 1169|  4.59k|                    i--;
 1170|  4.59k|                    continue;
 1171|  4.59k|                }
 1172|     40|                else {
 1173|     40|                    break;
 1174|     40|                }
 1175|  4.63k|            }
 1176|  11.1k|            buf[i] = c;
 1177|  11.1k|            ++i;
 1178|  11.1k|            if (i >= bufsize - 1) {
  ------------------
  |  Branch (1178:17): [True: 49, False: 11.0k]
  ------------------
 1179|     49|                return APR_ENOSPC;
  ------------------
  |  |  680|     49|#define APR_ENOSPC ENOSPC
  ------------------
 1180|     49|            }
 1181|  11.1k|        }
 1182|     55|        buf[i] = '\0';
 1183|     55|    }
 1184|  1.06k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.06k|#define APR_SUCCESS 0
  ------------------
 1185|  1.26k|}
util.c:cfg_trim_line:
 1188|  1.06k|{
 1189|  1.06k|    char *start, *end;
 1190|       |    /*
 1191|       |     * Leading and trailing white space is eliminated completely
 1192|       |     */
 1193|  1.06k|    start = buf;
 1194|  1.72k|    while (apr_isspace(*start))
  ------------------
  |  |  225|  1.72k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 664, False: 1.06k]
  |  |  ------------------
  ------------------
 1195|    664|        ++start;
 1196|       |    /* blast trailing whitespace */
 1197|  1.06k|    end = &start[strlen(start)];
 1198|  1.74k|    while (--end >= start && apr_isspace(*end))
  ------------------
  |  |  225|  1.70k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 679, False: 1.02k]
  |  |  ------------------
  ------------------
  |  Branch (1198:12): [True: 1.70k, False: 37]
  ------------------
 1199|    679|        *end = '\0';
 1200|       |    /* Zap leading whitespace by shifting */
 1201|  1.06k|    if (start != buf)
  ------------------
  |  Branch (1201:9): [True: 198, False: 867]
  ------------------
 1202|    198|        memmove(buf, start, end - start + 2);
 1203|       |#ifdef DEBUG_CFG_LINES
 1204|       |    ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, APLOGNO(00555) "Read config: '%s'", buf);
 1205|       |#endif
 1206|  1.06k|    return end - start + 1;
 1207|  1.06k|}
util.c:find_list_item:
 1424|  1.26k|{
 1425|  1.26k|    const unsigned char *pos;
 1426|  1.26k|    const unsigned char *ptr = (const unsigned char *)line;
 1427|  1.26k|    int good = 0, addspace = 0, in_qpair = 0, in_qstr = 0, in_com = 0;
 1428|       |
 1429|  1.26k|    if (!line || !tok) {
  ------------------
  |  Branch (1429:9): [True: 0, False: 1.26k]
  |  Branch (1429:18): [True: 0, False: 1.26k]
  ------------------
 1430|      0|        return 0;
 1431|      0|    }
 1432|  1.26k|    if (type == AP_ETAG_STRONG && *tok != '\"') {
  ------------------
  |  Branch (1432:9): [True: 0, False: 1.26k]
  |  Branch (1432:35): [True: 0, False: 0]
  ------------------
 1433|      0|        return 0;
 1434|      0|    }
 1435|  1.26k|    if (type == AP_ETAG_WEAK) {
  ------------------
  |  Branch (1435:9): [True: 0, False: 1.26k]
  ------------------
 1436|      0|        if (*tok == 'W' && (*(tok+1)) == '/' && (*(tok+2)) == '\"') {
  ------------------
  |  Branch (1436:13): [True: 0, False: 0]
  |  Branch (1436:28): [True: 0, False: 0]
  |  Branch (1436:49): [True: 0, False: 0]
  ------------------
 1437|      0|            tok += 2;
 1438|      0|        }
 1439|      0|        else if (*tok != '\"') {
  ------------------
  |  Branch (1439:18): [True: 0, False: 0]
  ------------------
 1440|      0|            return 0;
 1441|      0|        }
 1442|      0|    }
 1443|       |
 1444|  3.40k|    do {  /* loop for each item in line's list */
 1445|       |
 1446|       |        /* Find first non-comma, non-whitespace byte */
 1447|  8.05k|        while (*ptr == ',' || apr_isspace(*ptr)) {
  ------------------
  |  |  225|  4.77k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 1.37k, False: 3.40k]
  |  |  ------------------
  ------------------
  |  Branch (1447:16): [True: 3.27k, False: 4.77k]
  ------------------
 1448|  4.64k|            ++ptr;
 1449|  4.64k|        }
 1450|       |
 1451|       |        /* Account for strong or weak Etags, depending on our search */
 1452|  3.40k|        if (type == AP_ETAG_STRONG && *ptr != '\"') {
  ------------------
  |  Branch (1452:13): [True: 0, False: 3.40k]
  |  Branch (1452:39): [True: 0, False: 0]
  ------------------
 1453|      0|            break;
 1454|      0|        }
 1455|  3.40k|        if (type == AP_ETAG_WEAK) {
  ------------------
  |  Branch (1455:13): [True: 0, False: 3.40k]
  ------------------
 1456|      0|            if (*ptr == 'W' && (*(ptr+1)) == '/' && (*(ptr+2)) == '\"') {
  ------------------
  |  Branch (1456:17): [True: 0, False: 0]
  |  Branch (1456:32): [True: 0, False: 0]
  |  Branch (1456:53): [True: 0, False: 0]
  ------------------
 1457|      0|                ptr += 2;
 1458|      0|            }
 1459|      0|            else if (*ptr != '\"') {
  ------------------
  |  Branch (1459:22): [True: 0, False: 0]
  ------------------
 1460|      0|                break;
 1461|      0|            }
 1462|      0|        }
 1463|       |
 1464|  3.40k|        if (*ptr)
  ------------------
  |  Branch (1464:13): [True: 3.34k, False: 63]
  ------------------
 1465|  3.34k|            good = 1;  /* until proven otherwise for this item */
 1466|     63|        else
 1467|     63|            break;     /* no items left and nothing good found */
 1468|       |
 1469|       |        /* We skip extra whitespace and any whitespace around a '=', '/',
 1470|       |         * or ';' and lowercase normal characters not within a comment,
 1471|       |         * quoted-string or quoted-pair.
 1472|       |         */
 1473|  3.34k|        for (pos = (const unsigned char *)tok;
 1474|  53.6k|             *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1474:14): [True: 52.4k, False: 1.20k]
  |  Branch (1474:23): [True: 3.34k, False: 49.0k]
  |  Branch (1474:35): [True: 4.44k, False: 44.6k]
  |  Branch (1474:46): [True: 5.06k, False: 39.5k]
  |  Branch (1474:56): [True: 37.4k, False: 2.14k]
  ------------------
 1475|  50.2k|             ++ptr) {
 1476|       |
 1477|  50.2k|            if (in_qpair) {
  ------------------
  |  Branch (1477:17): [True: 3.34k, False: 46.9k]
  ------------------
 1478|  3.34k|                in_qpair = 0;
 1479|  3.34k|                if (good)
  ------------------
  |  Branch (1479:21): [True: 0, False: 3.34k]
  ------------------
 1480|      0|                    good = (*pos++ == *ptr);
 1481|  3.34k|            }
 1482|  46.9k|            else {
 1483|  46.9k|                switch (*ptr) {
 1484|  3.38k|                    case '\\': in_qpair = 1;
  ------------------
  |  Branch (1484:21): [True: 3.38k, False: 43.5k]
  ------------------
 1485|  3.38k|                               if (addspace == 1)
  ------------------
  |  Branch (1485:36): [True: 44, False: 3.34k]
  ------------------
 1486|     44|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1486:43): [True: 44, False: 0]
  |  Branch (1486:51): [True: 0, False: 44]
  ------------------
 1487|  3.38k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1487:39): [True: 102, False: 3.28k]
  |  Branch (1487:47): [True: 0, False: 102]
  ------------------
 1488|  3.38k|                               addspace = 0;
 1489|  3.38k|                               break;
 1490|  1.45k|                    case '"' : if (!in_com)
  ------------------
  |  Branch (1490:21): [True: 1.45k, False: 45.4k]
  |  Branch (1490:36): [True: 1.12k, False: 330]
  ------------------
 1491|  1.12k|                                   in_qstr = !in_qstr;
 1492|  1.45k|                               if (addspace == 1)
  ------------------
  |  Branch (1492:36): [True: 24, False: 1.43k]
  ------------------
 1493|     24|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1493:43): [True: 24, False: 0]
  |  Branch (1493:51): [True: 0, False: 24]
  ------------------
 1494|  1.45k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1494:39): [True: 85, False: 1.37k]
  |  Branch (1494:47): [True: 0, False: 85]
  ------------------
 1495|  1.45k|                               addspace = 0;
 1496|  1.45k|                               break;
 1497|  1.55k|                    case '(' : if (!in_qstr)
  ------------------
  |  Branch (1497:21): [True: 1.55k, False: 45.3k]
  |  Branch (1497:36): [True: 1.36k, False: 195]
  ------------------
 1498|  1.36k|                                   ++in_com;
 1499|  1.55k|                               if (addspace == 1)
  ------------------
  |  Branch (1499:36): [True: 35, False: 1.52k]
  ------------------
 1500|     35|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1500:43): [True: 35, False: 0]
  |  Branch (1500:51): [True: 0, False: 35]
  ------------------
 1501|  1.55k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1501:39): [True: 78, False: 1.47k]
  |  Branch (1501:47): [True: 0, False: 78]
  ------------------
 1502|  1.55k|                               addspace = 0;
 1503|  1.55k|                               break;
 1504|    789|                    case ')' : if (in_com)
  ------------------
  |  Branch (1504:21): [True: 789, False: 46.1k]
  |  Branch (1504:36): [True: 376, False: 413]
  ------------------
 1505|    376|                                   --in_com;
 1506|    789|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1506:39): [True: 85, False: 704]
  |  Branch (1506:47): [True: 0, False: 85]
  ------------------
 1507|    789|                               addspace = 0;
 1508|    789|                               break;
 1509|  2.71k|                    case ' ' :
  ------------------
  |  Branch (1509:21): [True: 2.71k, False: 44.2k]
  ------------------
 1510|  4.04k|                    case '\t': if (addspace || !good)
  ------------------
  |  Branch (1510:21): [True: 1.33k, False: 45.6k]
  |  Branch (1510:36): [True: 334, False: 3.71k]
  |  Branch (1510:48): [True: 3.52k, False: 195]
  ------------------
 1511|  3.85k|                                   break;
 1512|    195|                               if (in_com || in_qstr)
  ------------------
  |  Branch (1512:36): [True: 0, False: 195]
  |  Branch (1512:46): [True: 0, False: 195]
  ------------------
 1513|      0|                                   good = (*pos++ == *ptr);
 1514|    195|                               else
 1515|    195|                                   addspace = 1;
 1516|    195|                               break;
 1517|    440|                    case '=' :
  ------------------
  |  Branch (1517:21): [True: 440, False: 46.5k]
  ------------------
 1518|  1.28k|                    case '/' :
  ------------------
  |  Branch (1518:21): [True: 849, False: 46.0k]
  ------------------
 1519|  1.82k|                    case ';' : if (!(in_com || in_qstr))
  ------------------
  |  Branch (1519:21): [True: 538, False: 46.4k]
  |  Branch (1519:38): [True: 172, False: 1.65k]
  |  Branch (1519:48): [True: 244, False: 1.41k]
  ------------------
 1520|  1.41k|                                   addspace = -1;
 1521|  1.82k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1521:39): [True: 120, False: 1.70k]
  |  Branch (1521:47): [True: 0, False: 120]
  ------------------
 1522|  1.82k|                               break;
 1523|  33.8k|                    default  : if (!good)
  ------------------
  |  Branch (1523:21): [True: 33.8k, False: 13.0k]
  |  Branch (1523:36): [True: 30.7k, False: 3.10k]
  ------------------
 1524|  30.7k|                                   break;
 1525|  3.10k|                               if (addspace == 1)
  ------------------
  |  Branch (1525:36): [True: 79, False: 3.02k]
  ------------------
 1526|     79|                                   good = (*pos++ == ' ');
 1527|  3.10k|                               if (in_com || in_qstr)
  ------------------
  |  Branch (1527:36): [True: 0, False: 3.10k]
  |  Branch (1527:46): [True: 0, False: 3.10k]
  ------------------
 1528|      0|                                   good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1528:43): [True: 0, False: 0]
  |  Branch (1528:51): [True: 0, False: 0]
  ------------------
 1529|  3.10k|                               else
 1530|  3.10k|                                   good = good
  ------------------
  |  Branch (1530:43): [True: 3.02k, False: 79]
  ------------------
 1531|  3.10k|                                       && (apr_tolower(*pos++) == apr_tolower(*ptr));
  ------------------
  |  |  231|  3.02k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                                                     && (apr_tolower(*pos++) == apr_tolower(*ptr));
  ------------------
  |  |  231|  3.02k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (1531:43): [True: 470, False: 2.55k]
  ------------------
 1532|  3.10k|                               addspace = 0;
 1533|  3.10k|                               break;
 1534|  46.9k|                }
 1535|  46.9k|            }
 1536|  50.2k|        }
 1537|  3.34k|        if (good && *pos)
  ------------------
  |  Branch (1537:13): [True: 135, False: 3.20k]
  |  Branch (1537:21): [True: 133, False: 2]
  ------------------
 1538|    133|            good = 0;          /* not good if only a prefix was matched */
 1539|       |
 1540|  3.34k|    } while (*ptr && !good);
  ------------------
  |  Branch (1540:14): [True: 2.14k, False: 1.20k]
  |  Branch (1540:22): [True: 2.14k, False: 1]
  ------------------
 1541|       |
 1542|  1.26k|    return good;
 1543|  1.26k|}
util.c:find_last_token:
 1773|  2.51k|{
 1774|  2.51k|    int llen, tlen, lidx;
 1775|       |
 1776|  2.51k|    if (!line)
  ------------------
  |  Branch (1776:9): [True: 0, False: 2.51k]
  ------------------
 1777|      0|        return NULL;
 1778|       |
 1779|  2.51k|    llen = strlen(line);
 1780|  2.51k|    tlen = strlen(tok);
 1781|  2.51k|    lidx = llen - tlen;
 1782|       |
 1783|  2.51k|    if (lidx < 0 ||
  ------------------
  |  Branch (1783:9): [True: 191, False: 2.32k]
  ------------------
 1784|  2.51k|        (lidx > 0 && !(apr_isspace(line[lidx - 1]) || line[lidx - 1] == ',')))
  ------------------
  |  |  225|  4.56k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (225:24): [True: 273, False: 2.00k]
  |  |  ------------------
  ------------------
  |  Branch (1784:10): [True: 2.28k, False: 47]
  |  Branch (1784:55): [True: 133, False: 1.87k]
  ------------------
 1785|  2.06k|        return NULL;
 1786|       |
 1787|    453|    if (ap_cstr_casecmpn(&line[lidx], tok, tlen) == 0) { 
  ------------------
  |  Branch (1787:9): [True: 29, False: 424]
  ------------------
 1788|     29|        return &line[lidx];
 1789|     29|    }
 1790|    424|   return NULL;
 1791|    453|}
util.c:x2c:
 1859|    462|{
 1860|    462|    char digit;
 1861|       |
 1862|    462|#if !APR_CHARSET_EBCDIC
 1863|    462|    digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10
  ------------------
  |  Branch (1863:14): [True: 179, False: 283]
  ------------------
 1864|    462|             : (what[0] - '0'));
 1865|    462|    digit *= 16;
 1866|    462|    digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10
  ------------------
  |  Branch (1866:15): [True: 253, False: 209]
  ------------------
 1867|    462|              : (what[1] - '0'));
 1868|       |#else /*APR_CHARSET_EBCDIC*/
 1869|       |    char xstr[5];
 1870|       |    xstr[0]='0';
 1871|       |    xstr[1]='x';
 1872|       |    xstr[2]=what[0];
 1873|       |    xstr[3]=what[1];
 1874|       |    xstr[4]='\0';
 1875|       |    digit = apr_xlate_conv_byte(ap_hdrs_from_ascii,
 1876|       |                                0xFF & strtol(xstr, NULL, 16));
 1877|       |#endif /*APR_CHARSET_EBCDIC*/
 1878|    462|    return (digit);
 1879|    462|}
util.c:unescape_url:
 1892|    561|{
 1893|    561|    const int keep_slashes = (flags & AP_UNESCAPE_URL_KEEP_SLASHES) != 0,
  ------------------
  |  | 1816|    561|#define AP_UNESCAPE_URL_KEEP_SLASHES    (1u << 2)
  ------------------
 1894|    561|              forbid_slashes = (flags & AP_UNESCAPE_URL_FORBID_SLASHES) != 0,
  ------------------
  |  | 1815|    561|#define AP_UNESCAPE_URL_FORBID_SLASHES  (1u << 1)
  ------------------
 1895|    561|              keep_unreserved = (flags & AP_UNESCAPE_URL_KEEP_UNRESERVED) != 0;
  ------------------
  |  | 1814|    561|#define AP_UNESCAPE_URL_KEEP_UNRESERVED (1u << 0)
  ------------------
 1896|    561|    int badesc, badpath;
 1897|    561|    char *x, *y;
 1898|       |
 1899|    561|    badesc = 0;
 1900|    561|    badpath = 0;
 1901|       |
 1902|    561|    if (url == NULL) {
  ------------------
  |  Branch (1902:9): [True: 0, False: 561]
  ------------------
 1903|      0|        return OK;
  ------------------
  |  |  461|      0|#define OK 0                    /**< Module has handled this stage. */
  ------------------
 1904|      0|    }
 1905|       |    /* Initial scan for first '%'. Don't bother writing values before
 1906|       |     * seeing a '%' */
 1907|    561|    y = strchr(url, '%');
 1908|    561|    if (y == NULL) {
  ------------------
  |  Branch (1908:9): [True: 445, False: 116]
  ------------------
 1909|    445|        return OK;
  ------------------
  |  |  461|    445|#define OK 0                    /**< Module has handled this stage. */
  ------------------
 1910|    445|    }
 1911|  3.95k|    for (x = y; *y; ++x, ++y) {
  ------------------
  |  Branch (1911:17): [True: 3.83k, False: 116]
  ------------------
 1912|  3.83k|        if (*y != '%') {
  ------------------
  |  Branch (1912:13): [True: 2.59k, False: 1.24k]
  ------------------
 1913|  2.59k|            *x = *y;
 1914|  2.59k|        }
 1915|  1.24k|        else {
 1916|  1.24k|            if (!apr_isxdigit(*(y + 1)) || !apr_isxdigit(*(y + 2))) {
  ------------------
  |  |  229|  2.48k|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
                          if (!apr_isxdigit(*(y + 1)) || !apr_isxdigit(*(y + 2))) {
  ------------------
  |  |  229|    604|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
  |  Branch (1916:17): [True: 636, False: 604]
  |  Branch (1916:44): [True: 142, False: 462]
  ------------------
 1917|    778|                badesc = 1;
 1918|    778|                *x = '%';
 1919|    778|            }
 1920|    462|            else {
 1921|    462|                char decoded;
 1922|    462|                decoded = x2c(y + 1);
 1923|    462|                if ((decoded == '\0')
  ------------------
  |  Branch (1923:21): [True: 117, False: 345]
  ------------------
 1924|    462|                    || (forbid_slashes && IS_SLASH(decoded))
  ------------------
  |  |   87|      0|#define IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (87:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1924:25): [True: 0, False: 345]
  ------------------
 1925|    462|                    || (forbid && ap_strchr_c(forbid, decoded))) {
  ------------------
  |  | 2504|    255|# define ap_strchr_c(s, c)   strchr(s, c)
  |  |  ------------------
  |  |  |  Branch (2504:30): [True: 70, False: 185]
  |  |  ------------------
  ------------------
  |  Branch (1925:25): [True: 255, False: 90]
  ------------------
 1926|    187|                    badpath = 1;
 1927|    187|                    *x = decoded;
 1928|    187|                    y += 2;
 1929|    187|                }
 1930|    275|                else if ((keep_unreserved && TEST_CHAR(decoded,
  ------------------
  |  |   53|      0|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1930:27): [True: 0, False: 275]
  ------------------
 1931|    275|                                                       T_URI_UNRESERVED))
 1932|    275|                         || (keep_slashes && IS_SLASH(decoded))
  ------------------
  |  |   87|      0|#define IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (87:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1932:30): [True: 0, False: 275]
  ------------------
 1933|    275|                         || (reserved && ap_strchr_c(reserved, decoded))) {
  ------------------
  |  | 2504|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  |  |  ------------------
  |  |  |  Branch (2504:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1933:30): [True: 0, False: 275]
  ------------------
 1934|      0|                    *x++ = *y++;
 1935|      0|                    *x++ = *y++;
 1936|      0|                    *x = *y;
 1937|      0|                }
 1938|    275|                else {
 1939|    275|                    *x = decoded;
 1940|    275|                    y += 2;
 1941|    275|                }
 1942|    462|            }
 1943|  1.24k|        }
 1944|  3.83k|    }
 1945|    116|    *x = '\0';
 1946|    116|    if (badesc) {
  ------------------
  |  Branch (1946:9): [True: 93, False: 23]
  ------------------
 1947|     93|        return HTTP_BAD_REQUEST;
  ------------------
  |  |  513|     93|#define HTTP_BAD_REQUEST                     400
  ------------------
 1948|     93|    }
 1949|     23|    else if (badpath) {
  ------------------
  |  Branch (1949:14): [True: 9, False: 14]
  ------------------
 1950|      9|        return HTTP_NOT_FOUND;
  ------------------
  |  |  517|      9|#define HTTP_NOT_FOUND                       404
  ------------------
 1951|      9|    }
 1952|     14|    else {
 1953|     14|        return OK;
  ------------------
  |  |  461|     14|#define OK 0                    /**< Module has handled this stage. */
  ------------------
 1954|     14|    }
 1955|    116|}
util.c:c2x:
 2041|   111k|{
 2042|       |#if APR_CHARSET_EBCDIC
 2043|       |    what = apr_xlate_conv_byte(ap_hdrs_to_ascii, (unsigned char)what);
 2044|       |#endif /*APR_CHARSET_EBCDIC*/
 2045|   111k|    *where++ = prefix;
 2046|   111k|    *where++ = c2x_table[what >> 4];
 2047|   111k|    *where++ = c2x_table[what & 0xf];
 2048|   111k|    return where;
 2049|   111k|}

apr_atomic_init:
   29|  1.26k|{
   30|       |#if defined (NEED_ATOMICS_GENERIC64)
   31|       |    return apr__atomic_generic64_init(p);
   32|       |#else
   33|  1.26k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
   34|  1.26k|#endif
   35|  1.26k|}

apr_base64_decode_len:
  120|  1.29k|{
  121|  1.29k|    register const unsigned char *bufin;
  122|  1.29k|    register apr_size_t nprbytes;
  123|       |
  124|  1.29k|    bufin = (const unsigned char *) bufcoded;
  125|  7.94k|    while (pr2six[*(bufin++)] <= 63);
  ------------------
  |  Branch (125:12): [True: 6.64k, False: 1.29k]
  ------------------
  126|  1.29k|    nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
  127|  1.29k|    assert(nprbytes <= APR_BASE64_DECODE_MAX);
  128|       |
  129|  1.29k|    return (int)(((nprbytes + 3u) / 4u) * 3u + 1u);
  130|  1.29k|}
apr_base64_decode:
  133|  1.29k|{
  134|       |#if APR_CHARSET_EBCDIC
  135|       |    apr_size_t inbytes_left, outbytes_left;
  136|       |#endif /* APR_CHARSET_EBCDIC */
  137|  1.29k|    int len;
  138|       |
  139|  1.29k|    len = apr_base64_decode_binary((unsigned char *) bufplain, bufcoded);
  140|       |#if APR_CHARSET_EBCDIC
  141|       |    inbytes_left = outbytes_left = len;
  142|       |    apr_xlate_conv_buffer(xlate_to_ebcdic, bufplain, &inbytes_left,
  143|       |                          bufplain, &outbytes_left);
  144|       |#endif                /* APR_CHARSET_EBCDIC */
  145|  1.29k|    bufplain[len] = '\0';
  146|  1.29k|    return len;
  147|  1.29k|}
apr_base64_decode_binary:
  155|  1.29k|{
  156|  1.29k|    int nbytesdecoded;
  157|  1.29k|    register const unsigned char *bufin;
  158|  1.29k|    register unsigned char *bufout;
  159|  1.29k|    register apr_size_t nprbytes;
  160|       |
  161|  1.29k|    bufin = (const unsigned char *) bufcoded;
  162|  7.94k|    while (pr2six[*(bufin++)] <= 63);
  ------------------
  |  Branch (162:12): [True: 6.64k, False: 1.29k]
  ------------------
  163|  1.29k|    nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
  164|  1.29k|    assert(nprbytes <= APR_BASE64_DECODE_MAX);
  165|  1.29k|    nbytesdecoded = (int)(((nprbytes + 3u) / 4u) * 3u);
  166|       |
  167|  1.29k|    bufout = (unsigned char *) bufplain;
  168|  1.29k|    bufin = (const unsigned char *) bufcoded;
  169|       |
  170|  2.78k|    while (nprbytes >= 4) {
  ------------------
  |  Branch (170:12): [True: 1.48k, False: 1.29k]
  ------------------
  171|  1.48k|        *(bufout++) =
  172|  1.48k|            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
  173|  1.48k|        *(bufout++) =
  174|  1.48k|            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
  175|  1.48k|        *(bufout++) =
  176|  1.48k|            (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
  177|  1.48k|        bufin += 4;
  178|  1.48k|        nprbytes -= 4;
  179|  1.48k|    }
  180|       |
  181|       |    /* Note: (nprbytes == 1) would be an error, so just ignore that case */
  182|  1.29k|    if (nprbytes > 1) {
  ------------------
  |  Branch (182:9): [True: 228, False: 1.07k]
  ------------------
  183|    228|        *(bufout++) =
  184|    228|            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
  185|    228|    }
  186|  1.29k|    if (nprbytes > 2) {
  ------------------
  |  Branch (186:9): [True: 128, False: 1.17k]
  ------------------
  187|    128|        *(bufout++) =
  188|    128|            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
  189|    128|    }
  190|       |
  191|  1.29k|    return nbytesdecoded - (int)((4u - nprbytes) & 3u);
  192|  1.29k|}
apr_base64_encode_len:
  208|  1.26k|{
  209|  1.26k|    assert(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
  210|       |
  211|  1.26k|    return ((len + 2) / 3 * 4) + 1;
  212|  1.26k|}
apr_base64_encode:
  215|  1.26k|{
  216|  1.26k|#if !APR_CHARSET_EBCDIC
  217|  1.26k|    return apr_base64_encode_binary(encoded, (const unsigned char *) string, len);
  218|       |#else /* APR_CHARSET_EBCDIC */
  219|       |    int i;
  220|       |    char *p;
  221|       |
  222|       |    assert(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
  223|       |
  224|       |    p = encoded;
  225|       |    for (i = 0; i < len - 2; i += 3) {
  226|       |        *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F];
  227|       |        *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) |
  228|       |            ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)];
  229|       |        *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2) |
  230|       |            ((int) (os_toascii[string[i + 2]] & 0xC0) >> 6)];
  231|       |        *p++ = basis_64[os_toascii[string[i + 2]] & 0x3F];
  232|       |    }
  233|       |    if (i < len) {
  234|       |        *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F];
  235|       |        if (i == (len - 1)) {
  236|       |            *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4)];
  237|       |            *p++ = '=';
  238|       |        }
  239|       |        else {
  240|       |            *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) |
  241|       |                ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)];
  242|       |            *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2)];
  243|       |        }
  244|       |        *p++ = '=';
  245|       |    }
  246|       |
  247|       |    *p++ = '\0';
  248|       |    return (unsigned int)(p - encoded);
  249|       |#endif                /* APR_CHARSET_EBCDIC */
  250|  1.26k|}
apr_base64_encode_binary:
  257|  1.26k|{
  258|  1.26k|    int i;
  259|  1.26k|    char *p;
  260|       |
  261|  1.26k|    assert(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
  262|       |
  263|  1.26k|    p = encoded;
  264|  19.2k|    for (i = 0; i < len - 2; i += 3) {
  ------------------
  |  Branch (264:17): [True: 18.0k, False: 1.26k]
  ------------------
  265|  18.0k|        *p++ = basis_64[(string[i] >> 2) & 0x3F];
  266|  18.0k|        *p++ = basis_64[((string[i] & 0x3) << 4) |
  267|  18.0k|            ((int) (string[i + 1] & 0xF0) >> 4)];
  268|  18.0k|        *p++ = basis_64[((string[i + 1] & 0xF) << 2) |
  269|  18.0k|            ((int) (string[i + 2] & 0xC0) >> 6)];
  270|  18.0k|        *p++ = basis_64[string[i + 2] & 0x3F];
  271|  18.0k|    }
  272|  1.26k|    if (i < len) {
  ------------------
  |  Branch (272:9): [True: 608, False: 656]
  ------------------
  273|    608|        *p++ = basis_64[(string[i] >> 2) & 0x3F];
  274|    608|        if (i == (len - 1)) {
  ------------------
  |  Branch (274:13): [True: 340, False: 268]
  ------------------
  275|    340|            *p++ = basis_64[((string[i] & 0x3) << 4)];
  276|    340|            *p++ = '=';
  277|    340|        }
  278|    268|        else {
  279|    268|            *p++ = basis_64[((string[i] & 0x3) << 4) |
  280|    268|                ((int) (string[i + 1] & 0xF0) >> 4)];
  281|    268|            *p++ = basis_64[((string[i + 1] & 0xF) << 2)];
  282|    268|        }
  283|    608|        *p++ = '=';
  284|    608|    }
  285|       |
  286|  1.26k|    *p++ = '\0';
  287|  1.26k|    return (unsigned int)(p - encoded);
  288|  1.26k|}

apr_unix_mode2perms:
   72|  1.26k|{
   73|  1.26k|    apr_fileperms_t perms = 0;
   74|       |
   75|  1.26k|    if (mode & S_ISUID)
  ------------------
  |  Branch (75:9): [True: 0, False: 1.26k]
  ------------------
   76|      0|        perms |= APR_FPROT_USETID;
  ------------------
  |  |   79|      0|#define APR_FPROT_USETID      0x8000 /**< Set user id */
  ------------------
   77|  1.26k|    if (mode & S_IRUSR)
  ------------------
  |  Branch (77:9): [True: 1.26k, False: 0]
  ------------------
   78|  1.26k|        perms |= APR_FPROT_UREAD;
  ------------------
  |  |   80|  1.26k|#define APR_FPROT_UREAD       0x0400 /**< Read by user */
  ------------------
   79|  1.26k|    if (mode & S_IWUSR)
  ------------------
  |  Branch (79:9): [True: 1.26k, False: 0]
  ------------------
   80|  1.26k|        perms |= APR_FPROT_UWRITE;
  ------------------
  |  |   81|  1.26k|#define APR_FPROT_UWRITE      0x0200 /**< Write by user */
  ------------------
   81|  1.26k|    if (mode & S_IXUSR)
  ------------------
  |  Branch (81:9): [True: 0, False: 1.26k]
  ------------------
   82|      0|        perms |= APR_FPROT_UEXECUTE;
  ------------------
  |  |   82|      0|#define APR_FPROT_UEXECUTE    0x0100 /**< Execute by user */
  ------------------
   83|       |
   84|  1.26k|    if (mode & S_ISGID)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.26k]
  ------------------
   85|      0|        perms |= APR_FPROT_GSETID;
  ------------------
  |  |   84|      0|#define APR_FPROT_GSETID      0x4000 /**< Set group id */
  ------------------
   86|  1.26k|    if (mode & S_IRGRP)
  ------------------
  |  Branch (86:9): [True: 1.26k, False: 0]
  ------------------
   87|  1.26k|        perms |= APR_FPROT_GREAD;
  ------------------
  |  |   85|  1.26k|#define APR_FPROT_GREAD       0x0040 /**< Read by group */
  ------------------
   88|  1.26k|    if (mode & S_IWGRP)
  ------------------
  |  Branch (88:9): [True: 0, False: 1.26k]
  ------------------
   89|      0|        perms |= APR_FPROT_GWRITE;
  ------------------
  |  |   86|      0|#define APR_FPROT_GWRITE      0x0020 /**< Write by group */
  ------------------
   90|  1.26k|    if (mode & S_IXGRP)
  ------------------
  |  Branch (90:9): [True: 0, False: 1.26k]
  ------------------
   91|      0|        perms |= APR_FPROT_GEXECUTE;
  ------------------
  |  |   87|      0|#define APR_FPROT_GEXECUTE    0x0010 /**< Execute by group */
  ------------------
   92|       |
   93|  1.26k|#ifdef S_ISVTX
   94|  1.26k|    if (mode & S_ISVTX)
  ------------------
  |  Branch (94:9): [True: 0, False: 1.26k]
  ------------------
   95|      0|        perms |= APR_FPROT_WSTICKY;
  ------------------
  |  |   89|      0|#define APR_FPROT_WSTICKY     0x2000 /**< Sticky bit */
  ------------------
   96|  1.26k|#endif
   97|  1.26k|    if (mode & S_IROTH)
  ------------------
  |  Branch (97:9): [True: 1.26k, False: 0]
  ------------------
   98|  1.26k|        perms |= APR_FPROT_WREAD;
  ------------------
  |  |   90|  1.26k|#define APR_FPROT_WREAD       0x0004 /**< Read by others */
  ------------------
   99|  1.26k|    if (mode & S_IWOTH)
  ------------------
  |  Branch (99:9): [True: 0, False: 1.26k]
  ------------------
  100|      0|        perms |= APR_FPROT_WWRITE;
  ------------------
  |  |   91|      0|#define APR_FPROT_WWRITE      0x0002 /**< Write by others */
  ------------------
  101|  1.26k|    if (mode & S_IXOTH)
  ------------------
  |  Branch (101:9): [True: 0, False: 1.26k]
  ------------------
  102|      0|        perms |= APR_FPROT_WEXECUTE;
  ------------------
  |  |   92|      0|#define APR_FPROT_WEXECUTE    0x0001 /**< Execute by others */
  ------------------
  103|       |
  104|  1.26k|    return perms;
  105|  1.26k|}

apr_file_info_get:
  154|  1.26k|{
  155|  1.26k|    struct_stat info;
  156|       |
  157|  1.26k|    if (thefile->buffered) {
  ------------------
  |  Branch (157:9): [True: 1.26k, False: 0]
  ------------------
  158|  1.26k|        apr_status_t rv = apr_file_flush(thefile);
  159|  1.26k|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  |  Branch (159:13): [True: 0, False: 1.26k]
  ------------------
  160|      0|            return rv;
  161|  1.26k|    }
  162|       |
  163|  1.26k|    if (fstat(thefile->filedes, &info) == 0) {
  ------------------
  |  Branch (163:9): [True: 1.26k, False: 0]
  ------------------
  164|  1.26k|        finfo->pool = thefile->pool;
  165|  1.26k|        finfo->fname = thefile->fname;
  166|  1.26k|        fill_out_finfo(finfo, &info, wanted);
  167|  1.26k|        return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
  ------------------
  |  |  458|      0|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  |  Branch (167:16): [True: 0, False: 1.26k]
  ------------------
  168|  1.26k|    }
  169|      0|    else {
  170|      0|        return errno;
  171|      0|    }
  172|  1.26k|}
filestat.c:fill_out_finfo:
   72|  1.26k|{
   73|  1.26k|    finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  163|  1.26k|#define APR_FINFO_MIN    0x00008170 /**< type, mtime, ctime, atime, size */
  ------------------
                  finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  164|  1.26k|#define APR_FINFO_IDENT  0x00003000 /**< dev and inode */
  ------------------
                  finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  153|  1.26k|#define APR_FINFO_NLINK  0x00004000 /**< Number of links */
  ------------------
   74|  1.26k|                 | APR_FINFO_OWNER | APR_FINFO_PROT;
  ------------------
  |  |  165|  1.26k|#define APR_FINFO_OWNER  0x00030000 /**< user and group */
  ------------------
                               | APR_FINFO_OWNER | APR_FINFO_PROT;
  ------------------
  |  |  166|  1.26k|#define APR_FINFO_PROT   0x00700000 /**<  all protections */
  ------------------
   75|  1.26k|    finfo->protection = apr_unix_mode2perms(info->st_mode);
   76|  1.26k|    finfo->filetype = filetype_from_mode(info->st_mode);
   77|  1.26k|    finfo->user = info->st_uid;
   78|  1.26k|    finfo->group = info->st_gid;
   79|  1.26k|    finfo->size = info->st_size;
   80|  1.26k|    finfo->device = info->st_dev;
   81|  1.26k|    finfo->nlink = info->st_nlink;
   82|       |
   83|       |    /* Check for overflow if storing a 64-bit st_ino in a 32-bit
   84|       |     * apr_ino_t for LFS builds: */
   85|  1.26k|    if (sizeof(apr_ino_t) >= sizeof(info->st_ino)
  ------------------
  |  Branch (85:9): [Folded - Ignored]
  ------------------
   86|  1.26k|        || (apr_ino_t)info->st_ino == info->st_ino) {
  ------------------
  |  Branch (86:12): [True: 0, False: 0]
  ------------------
   87|  1.26k|        finfo->inode = info->st_ino;
   88|  1.26k|    } else {
   89|      0|        finfo->valid &= ~APR_FINFO_INODE;
  ------------------
  |  |  152|      0|#define APR_FINFO_INODE  0x00002000 /**< Inode */
  ------------------
   90|      0|    }
   91|       |
   92|  1.26k|    apr_time_ansi_put(&finfo->atime, info->st_atime);
   93|  1.26k|#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
   94|  1.26k|    finfo->atime += info->st_atim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.26k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  390|  1.26k| #define APR_INT64_C(val) INT64_C(val)
  |  |  ------------------
  ------------------
   95|       |#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC)
   96|       |    finfo->atime += info->st_atimensec / APR_TIME_C(1000);
   97|       |#elif defined(HAVE_STRUCT_STAT_ST_ATIME_N)
   98|       |    finfo->atime += info->st_atime_n / APR_TIME_C(1000);
   99|       |#endif
  100|       |
  101|  1.26k|    apr_time_ansi_put(&finfo->mtime, info->st_mtime);
  102|  1.26k|#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
  103|  1.26k|    finfo->mtime += info->st_mtim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.26k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  390|  1.26k| #define APR_INT64_C(val) INT64_C(val)
  |  |  ------------------
  ------------------
  104|       |#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
  105|       |    finfo->mtime += info->st_mtimensec / APR_TIME_C(1000);
  106|       |#elif defined(HAVE_STRUCT_STAT_ST_MTIME_N)
  107|       |    finfo->mtime += info->st_mtime_n / APR_TIME_C(1000);
  108|       |#endif
  109|       |
  110|  1.26k|    apr_time_ansi_put(&finfo->ctime, info->st_ctime);
  111|  1.26k|#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC
  112|  1.26k|    finfo->ctime += info->st_ctim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.26k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  390|  1.26k| #define APR_INT64_C(val) INT64_C(val)
  |  |  ------------------
  ------------------
  113|       |#elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC)
  114|       |    finfo->ctime += info->st_ctimensec / APR_TIME_C(1000);
  115|       |#elif defined(HAVE_STRUCT_STAT_ST_CTIME_N)
  116|       |    finfo->ctime += info->st_ctime_n / APR_TIME_C(1000);
  117|       |#endif
  118|       |
  119|  1.26k|#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
  120|  1.26k|#ifdef DEV_BSIZE
  121|  1.26k|    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)DEV_BSIZE;
  122|       |#else
  123|       |    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)512;
  124|       |#endif
  125|  1.26k|    finfo->valid |= APR_FINFO_CSIZE;
  ------------------
  |  |  150|  1.26k|#define APR_FINFO_CSIZE  0x00000200 /**< Storage size consumed by the file */
  ------------------
  126|  1.26k|#endif
  127|  1.26k|}
filestat.c:filetype_from_mode:
   28|  1.26k|{
   29|  1.26k|    apr_filetype_e type;
   30|       |
   31|  1.26k|    switch (mode & S_IFMT) {
   32|  1.26k|    case S_IFREG:
  ------------------
  |  Branch (32:5): [True: 1.26k, False: 0]
  ------------------
   33|  1.26k|        type = APR_REG;  break;
   34|      0|    case S_IFDIR:
  ------------------
  |  Branch (34:5): [True: 0, False: 1.26k]
  ------------------
   35|      0|        type = APR_DIR;  break;
   36|      0|    case S_IFLNK:
  ------------------
  |  Branch (36:5): [True: 0, False: 1.26k]
  ------------------
   37|      0|        type = APR_LNK;  break;
   38|      0|    case S_IFCHR:
  ------------------
  |  Branch (38:5): [True: 0, False: 1.26k]
  ------------------
   39|      0|        type = APR_CHR;  break;
   40|      0|    case S_IFBLK:
  ------------------
  |  Branch (40:5): [True: 0, False: 1.26k]
  ------------------
   41|      0|        type = APR_BLK;  break;
   42|       |#if defined(S_IFFIFO)
   43|       |    case S_IFFIFO:
   44|       |        type = APR_PIPE; break;
   45|       |#endif
   46|      0|#if !defined(BEOS) && defined(S_IFSOCK)
   47|      0|    case S_IFSOCK:
  ------------------
  |  Branch (47:5): [True: 0, False: 1.26k]
  ------------------
   48|      0|        type = APR_SOCK; break;
   49|      0|#endif
   50|       |
   51|      0|    default:
  ------------------
  |  Branch (51:5): [True: 0, False: 1.26k]
  ------------------
   52|       |	/* Work around missing S_IFxxx values above
   53|       |         * for Linux et al.
   54|       |         */
   55|      0|#if !defined(S_IFFIFO) && defined(S_ISFIFO)
   56|      0|    	if (S_ISFIFO(mode)) {
   57|      0|            type = APR_PIPE;
   58|      0|	} else
   59|      0|#endif
   60|       |#if !defined(BEOS) && !defined(S_IFSOCK) && defined(S_ISSOCK)
   61|       |    	if (S_ISSOCK(mode)) {
   62|       |            type = APR_SOCK;
   63|       |	} else
   64|       |#endif
   65|      0|        type = APR_UNKFILE;
   66|  1.26k|    }
   67|  1.26k|    return type;
   68|  1.26k|}

apr_unix_file_cleanup:
   73|  1.26k|{
   74|  1.26k|    apr_file_t *file = thefile;
   75|  1.26k|    apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
                  apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
   76|       |
   77|  1.26k|    if (file->buffered) {
  ------------------
  |  Branch (77:9): [True: 1.26k, False: 0]
  ------------------
   78|  1.26k|        flush_rv = apr_file_flush(file);
   79|  1.26k|    }
   80|       |
   81|  1.26k|    rv = file_cleanup(file, 0);
   82|       |
   83|  1.26k|    return rv != APR_SUCCESS ? rv : flush_rv;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  |  Branch (83:12): [True: 0, False: 1.26k]
  ------------------
   84|  1.26k|}
apr_file_open:
   96|  1.26k|{
   97|  1.26k|    apr_os_file_t fd;
   98|  1.26k|    int oflags = 0;
   99|  1.26k|#if APR_HAS_THREADS
  100|  1.26k|    apr_thread_mutex_t *thlock = NULL;
  101|  1.26k|#endif
  102|  1.26k|    apr_status_t rv;
  103|       |
  104|  1.26k|    if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) {
  ------------------
  |  |   54|  1.26k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  ------------------
                  if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) {
  ------------------
  |  |   55|  1.26k|#define APR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
  ------------------
  |  Branch (104:9): [True: 1.26k, False: 0]
  |  Branch (104:36): [True: 0, False: 1.26k]
  ------------------
  105|      0|        oflags = O_RDWR;
  106|      0|    }
  107|  1.26k|    else if (flag & APR_FOPEN_READ) {
  ------------------
  |  |   54|  1.26k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  ------------------
  |  Branch (107:14): [True: 1.26k, False: 0]
  ------------------
  108|  1.26k|        oflags = O_RDONLY;
  109|  1.26k|    }
  110|      0|    else if (flag & APR_FOPEN_WRITE) {
  ------------------
  |  |   55|      0|#define APR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
  ------------------
  |  Branch (110:14): [True: 0, False: 0]
  ------------------
  111|      0|        oflags = O_WRONLY;
  112|      0|    }
  113|      0|    else {
  114|      0|        return APR_EACCES;
  ------------------
  |  |  645|      0|#define APR_EACCES EACCES
  ------------------
  115|      0|    }
  116|       |
  117|  1.26k|    if (flag & APR_FOPEN_CREATE) {
  ------------------
  |  |   56|  1.26k|#define APR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
  ------------------
  |  Branch (117:9): [True: 0, False: 1.26k]
  ------------------
  118|      0|        oflags |= O_CREAT;
  119|      0|        if (flag & APR_FOPEN_EXCL) {
  ------------------
  |  |   63|      0|#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if #APR_FOPEN_CREATE
  ------------------
  |  Branch (119:13): [True: 0, False: 0]
  ------------------
  120|      0|            oflags |= O_EXCL;
  121|      0|        }
  122|      0|    }
  123|  1.26k|    if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) {
  ------------------
  |  |   63|  1.26k|#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if #APR_FOPEN_CREATE
  ------------------
                  if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) {
  ------------------
  |  |   56|      0|#define APR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
  ------------------
  |  Branch (123:9): [True: 0, False: 1.26k]
  |  Branch (123:36): [True: 0, False: 0]
  ------------------
  124|      0|        return APR_EACCES;
  ------------------
  |  |  645|      0|#define APR_EACCES EACCES
  ------------------
  125|      0|    }
  126|       |
  127|  1.26k|    if (flag & APR_FOPEN_APPEND) {
  ------------------
  |  |   57|  1.26k|#define APR_FOPEN_APPEND     0x00008  /**< Append to the end of the file */
  ------------------
  |  Branch (127:9): [True: 0, False: 1.26k]
  ------------------
  128|      0|        oflags |= O_APPEND;
  129|      0|    }
  130|  1.26k|    if (flag & APR_FOPEN_TRUNCATE) {
  ------------------
  |  |   58|  1.26k|#define APR_FOPEN_TRUNCATE   0x00010  /**< Open the file and truncate
  ------------------
  |  Branch (130:9): [True: 0, False: 1.26k]
  ------------------
  131|      0|        oflags |= O_TRUNC;
  132|      0|    }
  133|       |#ifdef O_BINARY
  134|       |    if (flag & APR_FOPEN_BINARY) {
  135|       |        oflags |= O_BINARY;
  136|       |    }
  137|       |#endif
  138|       |
  139|  1.26k|    if (flag & APR_FOPEN_NONBLOCK) {
  ------------------
  |  |   94|  1.26k|#define APR_FOPEN_NONBLOCK    0x40000 /**< Platform dependent flag to enable
  ------------------
  |  Branch (139:9): [True: 0, False: 1.26k]
  ------------------
  140|      0|#ifdef O_NONBLOCK
  141|      0|        oflags |= O_NONBLOCK;
  142|       |#else
  143|       |        return APR_ENOTIMPL;
  144|       |#endif
  145|      0|    }
  146|       |
  147|  1.26k|#ifdef O_CLOEXEC
  148|       |    /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels.
  149|       |     */
  150|  1.26k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.26k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (150:9): [True: 1.26k, False: 0]
  ------------------
  151|  1.26k|        oflags |= O_CLOEXEC;
  152|  1.26k|}
  153|  1.26k|#endif
  154|       |
  155|       |#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
  156|       |    oflags |= O_LARGEFILE;
  157|       |#elif defined(O_LARGEFILE)
  158|  1.26k|    if (flag & APR_FOPEN_LARGEFILE) {
  ------------------
  |  |   82|  1.26k|#define APR_FOPEN_LARGEFILE   0x04000 /**< Platform dependent flag to enable
  ------------------
  |  Branch (158:9): [True: 0, False: 1.26k]
  ------------------
  159|      0|        oflags |= O_LARGEFILE;
  160|      0|    }
  161|  1.26k|#endif
  162|       |
  163|  1.26k|#if APR_HAS_THREADS
  164|  1.26k|    if ((flag & APR_FOPEN_BUFFERED) && (flag & APR_FOPEN_XTHREAD)) {
  ------------------
  |  |   65|  1.26k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  ------------------
                  if ((flag & APR_FOPEN_BUFFERED) && (flag & APR_FOPEN_XTHREAD)) {
  ------------------
  |  |   67|  1.26k|#define APR_FOPEN_XTHREAD    0x00200  /**< Platform dependent tag to open
  ------------------
  |  Branch (164:9): [True: 1.26k, False: 0]
  |  Branch (164:40): [True: 0, False: 1.26k]
  ------------------
  165|      0|        rv = apr_thread_mutex_create(&thlock,
  166|      0|                                     APR_THREAD_MUTEX_DEFAULT, pool);
  ------------------
  |  |   43|      0|#define APR_THREAD_MUTEX_DEFAULT  0x0   /**< platform-optimal lock behavior */
  ------------------
  167|      0|        if (rv) {
  ------------------
  |  Branch (167:13): [True: 0, False: 0]
  ------------------
  168|      0|            return rv;
  169|      0|        }
  170|      0|    }
  171|  1.26k|#endif
  172|       |
  173|  1.26k|    if (perm == APR_FPROT_OS_DEFAULT) {
  ------------------
  |  |   94|  1.26k|#define APR_FPROT_OS_DEFAULT  0x0FFF /**< use OS's default permissions */
  ------------------
  |  Branch (173:9): [True: 1.26k, False: 0]
  ------------------
  174|  1.26k|        fd = open(fname, oflags, 0666);
  175|  1.26k|    }
  176|      0|    else {
  177|      0|        fd = open(fname, oflags, apr_unix_perms2mode(perm));
  178|      0|    }
  179|  1.26k|    if (fd < 0) {
  ------------------
  |  Branch (179:9): [True: 0, False: 1.26k]
  ------------------
  180|      0|       return errno;
  181|      0|    }
  182|  1.26k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.26k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (182:9): [True: 1.26k, False: 0]
  ------------------
  183|  1.26k|#ifdef O_CLOEXEC
  184|  1.26k|        static int has_o_cloexec = 0;
  185|  1.26k|        if (!has_o_cloexec)
  ------------------
  |  Branch (185:13): [True: 1, False: 1.26k]
  ------------------
  186|      1|#endif
  187|      1|        {
  188|      1|            int flags;
  189|       |
  190|      1|            if ((flags = fcntl(fd, F_GETFD)) == -1) {
  ------------------
  |  Branch (190:17): [True: 0, False: 1]
  ------------------
  191|      0|                close(fd);
  192|      0|                return errno;
  193|      0|            }
  194|      1|            if ((flags & FD_CLOEXEC) == 0) {
  ------------------
  |  Branch (194:17): [True: 0, False: 1]
  ------------------
  195|      0|                flags |= FD_CLOEXEC;
  196|      0|                if (fcntl(fd, F_SETFD, flags) == -1) {
  ------------------
  |  Branch (196:21): [True: 0, False: 0]
  ------------------
  197|      0|                    close(fd);
  198|      0|                    return errno;
  199|      0|                }
  200|      0|            }
  201|      1|#ifdef O_CLOEXEC
  202|      1|            else {
  203|      1|                has_o_cloexec = 1;
  204|      1|            }
  205|      1|#endif
  206|      1|        }
  207|  1.26k|    }
  208|       |
  209|  1.26k|    (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
  ------------------
  |  |  454|  1.26k|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  1.26k|    (*new)->pool = pool;
  211|  1.26k|    (*new)->flags = flag;
  212|  1.26k|    (*new)->filedes = fd;
  213|       |
  214|  1.26k|    (*new)->fname = apr_pstrdup(pool, fname);
  215|       |
  216|  1.26k|    (*new)->blocking = BLK_ON;
  217|  1.26k|    (*new)->buffered = (flag & APR_FOPEN_BUFFERED) > 0;
  ------------------
  |  |   65|  1.26k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  ------------------
  218|       |
  219|  1.26k|    if ((*new)->buffered) {
  ------------------
  |  Branch (219:9): [True: 1.26k, False: 0]
  ------------------
  220|  1.26k|        (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE);
  ------------------
  |  |  425|  1.26k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  221|  1.26k|        (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE;
  ------------------
  |  |   91|  1.26k|#define APR_FILE_DEFAULT_BUFSIZE 4096
  ------------------
  222|  1.26k|    }
  223|      0|    else {
  224|      0|        (*new)->buffer = NULL;
  225|      0|    }
  226|       |
  227|  1.26k|#if APR_HAS_THREADS
  228|  1.26k|    (*new)->thlock = thlock;
  229|  1.26k|#endif
  230|       |
  231|  1.26k|    (*new)->is_pipe = 0;
  232|  1.26k|    (*new)->timeout = -1;
  233|  1.26k|    (*new)->ungetchar = -1;
  234|  1.26k|    (*new)->eof_hit = 0;
  235|  1.26k|    (*new)->filePtr = 0;
  236|  1.26k|    (*new)->bufpos = 0;
  237|  1.26k|    (*new)->dataRead = 0;
  238|  1.26k|    (*new)->direction = 0;
  239|       |#ifndef WAITIO_USES_POLL
  240|       |    /* Start out with no pollset.  apr_wait_for_io_or_timeout() will
  241|       |     * initialize the pollset if needed.
  242|       |     */
  243|       |    (*new)->pollset = NULL;
  244|       |#endif
  245|  1.26k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.26k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (245:9): [True: 1.26k, False: 0]
  ------------------
  246|  1.26k|        apr_pool_cleanup_register((*new)->pool, (void *)(*new),
  247|  1.26k|                                  apr_unix_file_cleanup,
  248|  1.26k|                                  apr_unix_child_file_cleanup);
  249|  1.26k|    }
  250|       |
  251|  1.26k|    if ((flag & APR_FOPEN_ROTATING) || (flag & APR_FOPEN_MANUAL_ROTATE)) {
  ------------------
  |  |   90|  1.26k|#define APR_FOPEN_ROTATING  0x10000 /**< Do file file rotation checking */
  ------------------
                  if ((flag & APR_FOPEN_ROTATING) || (flag & APR_FOPEN_MANUAL_ROTATE)) {
  ------------------
  |  |   92|  1.26k|#define APR_FOPEN_MANUAL_ROTATE  0x20000 /**< Enable Manual rotation */
  ------------------
  |  Branch (251:9): [True: 0, False: 1.26k]
  |  Branch (251:40): [True: 0, False: 1.26k]
  ------------------
  252|      0|        (*new)->rotating = (apr_rotating_info_t *)apr_pcalloc(pool,
  ------------------
  |  |  454|      0|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|      0|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|      0|                                                              sizeof(apr_rotating_info_t));
  254|       |
  255|      0|        rv =  apr_file_info_get(&(*new)->rotating->finfo,
  256|      0|                                APR_FINFO_DEV|APR_FINFO_INODE, *new);
  ------------------
  |  |  151|      0|#define APR_FINFO_DEV    0x00001000 /**< Device */
  ------------------
                                              APR_FINFO_DEV|APR_FINFO_INODE, *new);
  ------------------
  |  |  152|      0|#define APR_FINFO_INODE  0x00002000 /**< Inode */
  ------------------
  257|      0|        if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (257:13): [True: 0, False: 0]
  ------------------
  258|      0|            return rv;
  259|      0|        }
  260|       |
  261|      0|        if (flag & APR_FOPEN_MANUAL_ROTATE) {
  ------------------
  |  |   92|      0|#define APR_FOPEN_MANUAL_ROTATE  0x20000 /**< Enable Manual rotation */
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            (*new)->rotating->manual = 1;
  263|      0|        }
  264|      0|        else {
  265|      0|            (*new)->rotating->manual = 0;
  266|      0|        }
  267|      0|        (*new)->rotating->timeout = 60;
  268|      0|        (*new)->rotating->lastcheck = apr_time_sec(apr_time_now());
  ------------------
  |  |   63|      0|#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|      0|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|      0|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  390|      0| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  269|      0|        (*new)->rotating->oflags = oflags;
  270|      0|        (*new)->rotating->perm = perm;
  271|      0|    }
  272|  1.26k|    else {
  273|  1.26k|        (*new)->rotating = NULL;
  274|  1.26k|    }
  275|       |
  276|  1.26k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  277|  1.26k|}
open.c:file_cleanup:
   31|  1.26k|{
   32|  1.26k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
   33|  1.26k|    int fd = file->filedes;
   34|       |
   35|       |    /* Set file descriptor to -1 before close(), so that there is no
   36|       |     * chance of returning an already closed FD from apr_os_file_get().
   37|       |     */
   38|  1.26k|    file->filedes = -1;
   39|       |
   40|  1.26k|    if (close(fd) == 0) {
  ------------------
  |  Branch (40:9): [True: 1.26k, False: 0]
  ------------------
   41|       |        /* Only the parent process should delete the file! */
   42|  1.26k|        if (!is_child && (file->flags & APR_FOPEN_DELONCLOSE)) {
  ------------------
  |  |   66|  1.26k|#define APR_FOPEN_DELONCLOSE 0x00100  /**< Delete the file after close */
  ------------------
  |  Branch (42:13): [True: 1.26k, False: 0]
  |  Branch (42:26): [True: 0, False: 1.26k]
  ------------------
   43|      0|            unlink(file->fname);
   44|      0|        }
   45|  1.26k|#if APR_HAS_THREADS
   46|  1.26k|        if (file->thlock) {
  ------------------
  |  Branch (46:13): [True: 0, False: 1.26k]
  ------------------
   47|      0|            rv = apr_thread_mutex_destroy(file->thlock);
   48|      0|        }
   49|  1.26k|#endif
   50|  1.26k|    }
   51|      0|    else {
   52|       |        /* Restore, close() was not successful. */
   53|      0|        file->filedes = fd;
   54|       |
   55|       |        /* Are there any error conditions other than EINTR or EBADF? */
   56|      0|        rv = errno;
   57|      0|    }
   58|       |#ifndef WAITIO_USES_POLL
   59|       |    if (file->pollset != NULL) {
   60|       |        apr_status_t pollset_rv = apr_pollset_destroy(file->pollset);
   61|       |        /* If the file close failed, return its error value,
   62|       |         * not apr_pollset_destroy()'s.
   63|       |         */
   64|       |        if (rv == APR_SUCCESS) {
   65|       |            rv = pollset_rv;
   66|       |        }
   67|       |    }
   68|       |#endif /* !WAITIO_USES_POLL */
   69|  1.26k|    return rv;
   70|  1.26k|}

apr_file_read:
   88|  15.7k|{
   89|  15.7k|    apr_ssize_t rv;
   90|  15.7k|    apr_size_t bytes_read;
   91|       |
   92|  15.7k|    if (*nbytes <= 0) {
  ------------------
  |  Branch (92:9): [True: 0, False: 15.7k]
  ------------------
   93|      0|        *nbytes = 0;
   94|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
   95|      0|    }
   96|       |
   97|  15.7k|    if (thefile->buffered) {
  ------------------
  |  Branch (97:9): [True: 15.7k, False: 0]
  ------------------
   98|  15.7k|        file_lock(thefile);
  ------------------
  |  |  133|  15.7k|#define file_lock(f)   do { \
  |  |  134|  15.7k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (134:32): [True: 0, False: 15.7k]
  |  |  ------------------
  |  |  135|  15.7k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  136|  15.7k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (136:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
   99|  15.7k|        rv = file_read_buffered(thefile, buf, nbytes);
  100|  15.7k|        file_unlock(thefile);
  ------------------
  |  |  137|  15.7k|#define file_unlock(f) do { \
  |  |  138|  15.7k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (138:32): [True: 0, False: 15.7k]
  |  |  ------------------
  |  |  139|  15.7k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  140|  15.7k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (140:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  101|  15.7k|        return rv;
  102|  15.7k|    }
  103|      0|    else {
  104|      0|        bytes_read = 0;
  105|      0|        if (thefile->ungetchar != -1) {
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|            bytes_read = 1;
  107|      0|            *(char *)buf = (char)thefile->ungetchar;
  108|      0|            buf = (char *)buf + 1;
  109|      0|            (*nbytes)--;
  110|      0|            thefile->ungetchar = -1;
  111|      0|            if (*nbytes == 0) {
  ------------------
  |  Branch (111:17): [True: 0, False: 0]
  ------------------
  112|      0|                *nbytes = bytes_read;
  113|      0|                return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  114|      0|            }
  115|      0|        }
  116|       |
  117|      0|        do {
  118|      0|            rv = read(thefile->filedes, buf, *nbytes);
  119|      0|        } while (rv == -1 && errno == EINTR);
  ------------------
  |  Branch (119:18): [True: 0, False: 0]
  |  Branch (119:30): [True: 0, False: 0]
  ------------------
  120|      0|#ifdef USE_WAIT_FOR_IO
  121|      0|        if (rv == -1 &&
  ------------------
  |  Branch (121:13): [True: 0, False: 0]
  ------------------
  122|      0|            (errno == EAGAIN || errno == EWOULDBLOCK) &&
  ------------------
  |  Branch (122:14): [True: 0, False: 0]
  |  Branch (122:33): [True: 0, False: 0]
  ------------------
  123|      0|            thefile->timeout != 0) {
  ------------------
  |  Branch (123:13): [True: 0, False: 0]
  ------------------
  124|      0|            apr_status_t arv = apr_wait_for_io_or_timeout(thefile, NULL, 1);
  125|      0|            if (arv != APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (125:17): [True: 0, False: 0]
  ------------------
  126|      0|                *nbytes = bytes_read;
  127|      0|                return arv;
  128|      0|            }
  129|      0|            else {
  130|      0|                do {
  131|      0|                    rv = read(thefile->filedes, buf, *nbytes);
  132|      0|                } while (rv == -1 && errno == EINTR);
  ------------------
  |  Branch (132:26): [True: 0, False: 0]
  |  Branch (132:38): [True: 0, False: 0]
  ------------------
  133|      0|            }
  134|      0|        }
  135|      0|#endif
  136|      0|        *nbytes = bytes_read;
  137|      0|        if (rv == 0) {
  ------------------
  |  Branch (137:13): [True: 0, False: 0]
  ------------------
  138|      0|            thefile->eof_hit = TRUE;
  ------------------
  |  |   55|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   51|      0|#define FALSE 0
  |  |  ------------------
  ------------------
  139|      0|            return APR_EOF;
  ------------------
  |  |  467|      0|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|      0|        }
  141|      0|        if (rv > 0) {
  ------------------
  |  Branch (141:13): [True: 0, False: 0]
  ------------------
  142|      0|            *nbytes += rv;
  143|      0|            return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  144|      0|        }
  145|      0|        return errno;
  146|      0|    }
  147|  15.7k|}
apr_file_getc:
  391|  15.7k|{
  392|  15.7k|    apr_size_t nbytes = 1;
  393|       |
  394|  15.7k|    return apr_file_read(thefile, ch, &nbytes);
  395|  15.7k|}
apr_file_flush_locked:
  403|  2.52k|{
  404|  2.52k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  2.52k|#define APR_SUCCESS 0
  ------------------
  405|       |
  406|  2.52k|    if (thefile->direction == 1 && thefile->bufpos) {
  ------------------
  |  Branch (406:9): [True: 0, False: 2.52k]
  |  Branch (406:36): [True: 0, False: 0]
  ------------------
  407|      0|        apr_ssize_t written = 0, ret;
  408|       |
  409|      0|        do {
  410|      0|            ret = write(thefile->filedes, thefile->buffer + written,
  411|      0|                        thefile->bufpos - written);
  412|      0|            if (ret > 0)
  ------------------
  |  Branch (412:17): [True: 0, False: 0]
  ------------------
  413|      0|                written += ret;
  414|      0|        } while (written < thefile->bufpos &&
  ------------------
  |  Branch (414:18): [True: 0, False: 0]
  ------------------
  415|      0|                 (ret > 0 || (ret == -1 && errno == EINTR)));
  ------------------
  |  Branch (415:19): [True: 0, False: 0]
  |  Branch (415:31): [True: 0, False: 0]
  |  Branch (415:44): [True: 0, False: 0]
  ------------------
  416|      0|        if (ret == -1) {
  ------------------
  |  Branch (416:13): [True: 0, False: 0]
  ------------------
  417|      0|            rv = errno;
  418|      0|        } else {
  419|      0|            thefile->filePtr += written;
  420|      0|            thefile->bufpos = 0;
  421|      0|        }
  422|      0|    }
  423|       |
  424|  2.52k|    return rv;
  425|  2.52k|}
apr_file_flush:
  428|  2.52k|{
  429|  2.52k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  2.52k|#define APR_SUCCESS 0
  ------------------
  430|       |
  431|  2.52k|    if (thefile->buffered) {
  ------------------
  |  Branch (431:9): [True: 2.52k, False: 0]
  ------------------
  432|  2.52k|        file_lock(thefile);
  ------------------
  |  |  133|  2.52k|#define file_lock(f)   do { \
  |  |  134|  2.52k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (134:32): [True: 0, False: 2.52k]
  |  |  ------------------
  |  |  135|  2.52k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  136|  2.52k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (136:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  433|  2.52k|        rv = apr_file_flush_locked(thefile);
  434|  2.52k|        file_unlock(thefile);
  ------------------
  |  |  137|  2.52k|#define file_unlock(f) do { \
  |  |  138|  2.52k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (138:32): [True: 0, False: 2.52k]
  |  |  ------------------
  |  |  139|  2.52k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  140|  2.52k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (140:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  435|  2.52k|    }
  436|       |    /* There isn't anything to do if we aren't buffering the output
  437|       |     * so just return success.
  438|       |     */
  439|  2.52k|    return rv;
  440|  2.52k|}
apr_file_gets:
  503|   772k|{
  504|   772k|    apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */
  ------------------
  |  |  225|   772k|#define APR_SUCCESS 0
  ------------------
  505|   772k|    apr_size_t nbytes;
  506|   772k|    const char *str_start = str;
  507|   772k|    char *final = str + len - 1;
  508|       |
  509|   772k|    if (len <= 1) {
  ------------------
  |  Branch (509:9): [True: 0, False: 772k]
  ------------------
  510|       |        /* sort of like fgets(), which returns NULL and stores no bytes
  511|       |         */
  512|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  513|      0|    }
  514|       |
  515|       |    /* If we have an underlying buffer, we can be *much* more efficient
  516|       |     * and skip over the apr_file_read calls.
  517|       |     */
  518|   772k|    if (thefile->buffered) {
  ------------------
  |  Branch (518:9): [True: 772k, False: 0]
  ------------------
  519|   772k|        file_lock(thefile);
  ------------------
  |  |  133|   772k|#define file_lock(f)   do { \
  |  |  134|   772k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (134:32): [True: 0, False: 772k]
  |  |  ------------------
  |  |  135|   772k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  136|   772k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (136:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  520|       |
  521|   772k|        if (thefile->direction == 1) {
  ------------------
  |  Branch (521:13): [True: 0, False: 772k]
  ------------------
  522|      0|            rv = apr_file_flush_locked(thefile);
  523|      0|            if (rv) {
  ------------------
  |  Branch (523:17): [True: 0, False: 0]
  ------------------
  524|      0|                file_unlock(thefile);
  ------------------
  |  |  137|      0|#define file_unlock(f) do { \
  |  |  138|      0|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (138:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  140|      0|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (140:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  525|      0|                return rv;
  526|      0|            }
  527|       |
  528|      0|            thefile->direction = 0;
  529|      0|            thefile->bufpos = 0;
  530|      0|            thefile->dataRead = 0;
  531|      0|        }
  532|       |
  533|  1.63M|        while (str < final) { /* leave room for trailing '\0' */
  ------------------
  |  Branch (533:16): [True: 1.63M, False: 757]
  ------------------
  534|       |            /* Force ungetc leftover to call apr_file_read. */
  535|  1.63M|            if (thefile->bufpos < thefile->dataRead &&
  ------------------
  |  Branch (535:17): [True: 1.63M, False: 1.55k]
  ------------------
  536|  1.63M|                thefile->ungetchar == -1) {
  ------------------
  |  Branch (536:17): [True: 1.63M, False: 0]
  ------------------
  537|  1.63M|                *str = thefile->buffer[thefile->bufpos++];
  538|  1.63M|            }
  539|  1.55k|            else {
  540|  1.55k|                nbytes = 1;
  541|  1.55k|                rv = file_read_buffered(thefile, str, &nbytes);
  542|  1.55k|                if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|  1.55k|#define APR_SUCCESS 0
  ------------------
  |  Branch (542:21): [True: 25, False: 1.53k]
  ------------------
  543|     25|                    break;
  544|     25|                }
  545|  1.55k|            }
  546|  1.63M|            if (*str == '\n') {
  ------------------
  |  Branch (546:17): [True: 771k, False: 862k]
  ------------------
  547|   771k|                ++str;
  548|   771k|                break;
  549|   771k|            }
  550|   862k|            ++str;
  551|   862k|        }
  552|   772k|        file_unlock(thefile);
  ------------------
  |  |  137|   772k|#define file_unlock(f) do { \
  |  |  138|   772k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (138:32): [True: 0, False: 772k]
  |  |  ------------------
  |  |  139|   772k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  140|   772k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (140:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  553|   772k|    }
  554|      0|    else {
  555|      0|        while (str < final) { /* leave room for trailing '\0' */
  ------------------
  |  Branch (555:16): [True: 0, False: 0]
  ------------------
  556|      0|            nbytes = 1;
  557|      0|            rv = apr_file_read(thefile, str, &nbytes);
  558|      0|            if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (558:17): [True: 0, False: 0]
  ------------------
  559|      0|                break;
  560|      0|            }
  561|      0|            if (*str == '\n') {
  ------------------
  |  Branch (561:17): [True: 0, False: 0]
  ------------------
  562|      0|                ++str;
  563|      0|                break;
  564|      0|            }
  565|      0|            ++str;
  566|      0|        }
  567|      0|    }
  568|       |
  569|       |    /* We must store a terminating '\0' if we've stored any chars. We can
  570|       |     * get away with storing it if we hit an error first.
  571|       |     */
  572|   772k|    *str = '\0';
  573|   772k|    if (str > str_start) {
  ------------------
  |  Branch (573:9): [True: 772k, False: 15]
  ------------------
  574|       |        /* we stored chars; don't report EOF or any other errors;
  575|       |         * the app will find out about that on the next call
  576|       |         */
  577|   772k|        return APR_SUCCESS;
  ------------------
  |  |  225|   772k|#define APR_SUCCESS 0
  ------------------
  578|   772k|    }
  579|     15|    return rv;
  580|   772k|}
readwrite.c:file_read_buffered:
   32|  17.3k|{
   33|  17.3k|    apr_ssize_t rv;
   34|  17.3k|    char *pos = (char *)buf;
   35|  17.3k|    apr_uint64_t blocksize;
   36|  17.3k|    apr_uint64_t size = *nbytes;
   37|       |
   38|  17.3k|    if (thefile->direction == 1) {
  ------------------
  |  Branch (38:9): [True: 0, False: 17.3k]
  ------------------
   39|      0|        rv = apr_file_flush_locked(thefile);
   40|      0|        if (rv) {
  ------------------
  |  Branch (40:13): [True: 0, False: 0]
  ------------------
   41|      0|            return rv;
   42|      0|        }
   43|      0|        thefile->bufpos = 0;
   44|      0|        thefile->direction = 0;
   45|      0|        thefile->dataRead = 0;
   46|      0|    }
   47|       |
   48|  17.3k|    rv = 0;
   49|  17.3k|    if (thefile->ungetchar != -1) {
  ------------------
  |  Branch (49:9): [True: 0, False: 17.3k]
  ------------------
   50|      0|        *pos = (char)thefile->ungetchar;
   51|      0|        ++pos;
   52|      0|        --size;
   53|      0|        thefile->ungetchar = -1;
   54|      0|    }
   55|  34.5k|    while (rv == 0 && size > 0) {
  ------------------
  |  Branch (55:12): [True: 34.5k, False: 0]
  |  Branch (55:23): [True: 17.3k, False: 17.2k]
  ------------------
   56|  17.3k|        if (thefile->bufpos >= thefile->dataRead) {
  ------------------
  |  Branch (56:13): [True: 1.67k, False: 15.6k]
  ------------------
   57|  1.67k|            int bytesread = read(thefile->filedes, thefile->buffer,
   58|  1.67k|                                 thefile->bufsize);
   59|  1.67k|            if (bytesread == 0) {
  ------------------
  |  Branch (59:17): [True: 40, False: 1.63k]
  ------------------
   60|     40|                thefile->eof_hit = TRUE;
  ------------------
  |  |   55|     40|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   51|     40|#define FALSE 0
  |  |  ------------------
  ------------------
   61|     40|                rv = APR_EOF;
  ------------------
  |  |  467|     40|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|     40|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     40|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     40|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   62|     40|                break;
   63|     40|            }
   64|  1.63k|            else if (bytesread == -1) {
  ------------------
  |  Branch (64:22): [True: 0, False: 1.63k]
  ------------------
   65|      0|                rv = errno;
   66|      0|                break;
   67|      0|            }
   68|  1.63k|            thefile->dataRead = bytesread;
   69|  1.63k|            thefile->filePtr += thefile->dataRead;
   70|  1.63k|            thefile->bufpos = 0;
   71|  1.63k|        }
   72|       |
   73|  17.2k|        blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size;
  ------------------
  |  Branch (73:21): [True: 0, False: 17.2k]
  ------------------
   74|  17.2k|        memcpy(pos, thefile->buffer + thefile->bufpos, blocksize);
   75|  17.2k|        thefile->bufpos += blocksize;
   76|  17.2k|        pos += blocksize;
   77|  17.2k|        size -= blocksize;
   78|  17.2k|    }
   79|       |
   80|  17.3k|    *nbytes = pos - (char *)buf;
   81|  17.3k|    if (*nbytes) {
  ------------------
  |  Branch (81:9): [True: 17.2k, False: 40]
  ------------------
   82|  17.2k|        rv = 0;
   83|  17.2k|    }
   84|  17.3k|    return rv;
   85|  17.3k|}

apr_thread_mutex_create:
   40|  1.26k|{
   41|  1.26k|    apr_thread_mutex_t *new_mutex;
   42|  1.26k|    apr_status_t rv;
   43|       |
   44|       |#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE
   45|       |    if (flags & APR_THREAD_MUTEX_NESTED) {
   46|       |        return APR_ENOTIMPL;
   47|       |    }
   48|       |#endif
   49|       |
   50|  1.26k|    new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t));
  ------------------
  |  |  454|  1.26k|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|  1.26k|    new_mutex->pool = pool;
   52|       |
   53|  1.26k|#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE
   54|  1.26k|    if (flags & APR_THREAD_MUTEX_NESTED) {
  ------------------
  |  |   44|  1.26k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
  |  Branch (54:9): [True: 1.26k, False: 0]
  ------------------
   55|  1.26k|        pthread_mutexattr_t mattr;
   56|       |
   57|  1.26k|        rv = pthread_mutexattr_init(&mattr);
   58|  1.26k|        if (rv) return rv;
  ------------------
  |  Branch (58:13): [True: 0, False: 1.26k]
  ------------------
   59|       |
   60|  1.26k|        rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
   61|  1.26k|        if (rv) {
  ------------------
  |  Branch (61:13): [True: 0, False: 1.26k]
  ------------------
   62|      0|            pthread_mutexattr_destroy(&mattr);
   63|      0|            return rv;
   64|      0|        }
   65|       |
   66|  1.26k|        rv = pthread_mutex_init(&new_mutex->mutex, &mattr);
   67|       |
   68|  1.26k|        pthread_mutexattr_destroy(&mattr);
   69|  1.26k|    } else
   70|      0|#endif
   71|      0|    {
   72|       |#if defined(APR_THREAD_DEBUG)
   73|       |        pthread_mutexattr_t mattr;
   74|       |
   75|       |        rv = pthread_mutexattr_init(&mattr);
   76|       |        if (rv) return rv;
   77|       |
   78|       |        rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_ERRORCHECK);
   79|       |        if (rv) {
   80|       |            pthread_mutexattr_destroy(&mattr);
   81|       |            return rv;
   82|       |        }
   83|       |
   84|       |        rv = pthread_mutex_init(&new_mutex->mutex, &mattr);
   85|       |
   86|       |        pthread_mutexattr_destroy(&mattr);
   87|       |#else
   88|      0|        rv = pthread_mutex_init(&new_mutex->mutex, NULL);
   89|      0|#endif
   90|      0|    }
   91|       |
   92|  1.26k|    if (rv) {
  ------------------
  |  Branch (92:9): [True: 0, False: 1.26k]
  ------------------
   93|       |#ifdef HAVE_ZOS_PTHREADS
   94|       |        rv = errno;
   95|       |#endif
   96|      0|        return rv;
   97|      0|    }
   98|       |
   99|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  100|       |    if (flags & APR_THREAD_MUTEX_TIMED) {
  101|       |        rv = apr_thread_cond_create(&new_mutex->cond, pool);
  102|       |        if (rv) {
  103|       |#ifdef HAVE_ZOS_PTHREADS
  104|       |            rv = errno;
  105|       |#endif
  106|       |            pthread_mutex_destroy(&new_mutex->mutex);
  107|       |            return rv;
  108|       |        }
  109|       |    }
  110|       |#endif
  111|       |
  112|  1.26k|    apr_pool_cleanup_register(new_mutex->pool,
  113|  1.26k|                              new_mutex, thread_mutex_cleanup,
  114|  1.26k|                              apr_pool_cleanup_null);
  115|       |
  116|  1.26k|    *mutex = new_mutex;
  117|  1.26k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  118|  1.26k|}
apr_thread_mutex_lock:
  121|  1.26k|{
  122|  1.26k|    apr_status_t rv;
  123|       |
  124|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  125|       |    if (mutex->cond) {
  126|       |        apr_status_t rv2;
  127|       |
  128|       |        rv = pthread_mutex_lock(&mutex->mutex);
  129|       |        if (rv) {
  130|       |#ifdef HAVE_ZOS_PTHREADS
  131|       |            rv = errno;
  132|       |#endif
  133|       |            return rv;
  134|       |        }
  135|       |
  136|       |        if (mutex->locked) {
  137|       |            mutex->num_waiters++;
  138|       |            rv = apr_thread_cond_wait(mutex->cond, mutex);
  139|       |            mutex->num_waiters--;
  140|       |        }
  141|       |        else {
  142|       |            mutex->locked = 1;
  143|       |        }
  144|       |
  145|       |        rv2 = pthread_mutex_unlock(&mutex->mutex);
  146|       |        if (rv2 && !rv) {
  147|       |#ifdef HAVE_ZOS_PTHREADS
  148|       |            rv = errno;
  149|       |#else
  150|       |            rv = rv2;
  151|       |#endif
  152|       |        }
  153|       |
  154|       |        return rv;
  155|       |    }
  156|       |#endif
  157|       |
  158|  1.26k|    rv = pthread_mutex_lock(&mutex->mutex);
  159|       |#ifdef HAVE_ZOS_PTHREADS
  160|       |    if (rv) {
  161|       |        rv = errno;
  162|       |    }
  163|       |#endif
  164|       |
  165|  1.26k|    return rv;
  166|  1.26k|}
apr_thread_mutex_unlock:
  302|  1.26k|{
  303|  1.26k|    apr_status_t status;
  304|       |
  305|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  306|       |    if (mutex->cond) {
  307|       |        status = pthread_mutex_lock(&mutex->mutex);
  308|       |        if (status) {
  309|       |#ifdef HAVE_ZOS_PTHREADS
  310|       |            status = errno;
  311|       |#endif
  312|       |            return status;
  313|       |        }
  314|       |
  315|       |        if (!mutex->locked) {
  316|       |            status = APR_EINVAL;
  317|       |        }
  318|       |        else if (mutex->num_waiters) {
  319|       |            status = apr_thread_cond_signal(mutex->cond);
  320|       |        }
  321|       |        if (status) {
  322|       |            pthread_mutex_unlock(&mutex->mutex);
  323|       |            return status;
  324|       |        }
  325|       |
  326|       |        mutex->locked = 0;
  327|       |    }
  328|       |#endif
  329|       |
  330|  1.26k|    status = pthread_mutex_unlock(&mutex->mutex);
  331|       |#ifdef HAVE_ZOS_PTHREADS
  332|       |    if (status) {
  333|       |        status = errno;
  334|       |    }
  335|       |#endif
  336|       |
  337|  1.26k|    return status;
  338|  1.26k|}
thread_mutex.c:thread_mutex_cleanup:
   24|  1.26k|{
   25|  1.26k|    apr_thread_mutex_t *mutex = data;
   26|  1.26k|    apr_status_t rv;
   27|       |
   28|  1.26k|    rv = pthread_mutex_destroy(&mutex->mutex);
   29|       |#ifdef HAVE_ZOS_PTHREADS
   30|       |    if (rv) {
   31|       |        rv = errno;
   32|       |    }
   33|       |#endif
   34|  1.26k|    return rv;
   35|  1.26k|}

apr_pool_initialize:
 1674|  1.26k|{
 1675|  1.26k|    apr_status_t rv;
 1676|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1677|       |    char *logpath;
 1678|       |    apr_file_t *debug_log = NULL;
 1679|       |#endif
 1680|       |
 1681|  1.26k|    if (apr_pools_initialized++)
  ------------------
  |  Branch (1681:9): [True: 0, False: 1.26k]
  ------------------
 1682|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
 1683|       |
 1684|  1.26k|#if defined(_SC_PAGESIZE)
 1685|  1.26k|    boundary_size = sysconf(_SC_PAGESIZE);
 1686|       |#elif defined(WIN32)
 1687|       |    {
 1688|       |        SYSTEM_INFO si;
 1689|       |        GetSystemInfo(&si);
 1690|       |        boundary_size = si.dwPageSize;
 1691|       |    }
 1692|       |#endif
 1693|  1.26k|    boundary_index = 12;
 1694|  1.26k|    while ( (1 << boundary_index) < boundary_size)
  ------------------
  |  Branch (1694:13): [True: 0, False: 1.26k]
  ------------------
 1695|      0|        boundary_index++;
 1696|  1.26k|    boundary_size = (1 << boundary_index);
 1697|       |
 1698|       |    /* Since the debug code works a bit differently then the
 1699|       |     * regular pools code, we ask for a lock here.  The regular
 1700|       |     * pools code has got this lock embedded in the global
 1701|       |     * allocator, a concept unknown to debug mode.
 1702|       |     */
 1703|  1.26k|    if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL,
  ------------------
  |  |  247|  1.26k|    apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
  |  |  248|  1.26k|                             APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1703:9): [True: 0, False: 1.26k]
  ------------------
 1704|  1.26k|                                 NULL)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
 1705|      0|        return rv;
 1706|      0|    }
 1707|       |
 1708|  1.26k|    apr_pool_tag(global_pool, "APR global pool");
 1709|       |
 1710|  1.26k|    apr_pools_initialized = 1;
 1711|       |
 1712|       |    /* This has to happen here because mutexes might be backed by
 1713|       |     * atomics.  It used to be snug and safe in apr_initialize().
 1714|       |     */
 1715|  1.26k|    if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1715:9): [True: 0, False: 1.26k]
  ------------------
 1716|      0|        return rv;
 1717|      0|    }
 1718|       |
 1719|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1720|       |    rv = apr_env_get(&logpath, "APR_POOL_DEBUG_LOG", global_pool);
 1721|       |
 1722|       |    /* Don't pass file_stderr directly to apr_file_open() here, since
 1723|       |     * apr_file_open() can call back to apr_pool_log_event() and that
 1724|       |     * may attempt to use then then non-NULL but partially set up file
 1725|       |     * object. */
 1726|       |    if (rv == APR_SUCCESS) {
 1727|       |        apr_file_open(&debug_log, logpath,
 1728|       |                      APR_FOPEN_APPEND|APR_FOPEN_WRITE|APR_FOPEN_CREATE,
 1729|       |                      APR_FPROT_OS_DEFAULT, global_pool);
 1730|       |    }
 1731|       |    else {
 1732|       |        apr_file_open_stderr(&debug_log, global_pool);
 1733|       |    }
 1734|       |
 1735|       |    /* debug_log is now a file handle. */
 1736|       |    file_stderr = debug_log;
 1737|       |
 1738|       |    if (file_stderr) {
 1739|       |        apr_file_printf(file_stderr,
 1740|       |            "POOL DEBUG: [PID"
 1741|       |#if APR_HAS_THREADS
 1742|       |            "/TID"
 1743|       |#endif /* APR_HAS_THREADS */
 1744|       |            "] ACTION  (SIZE      /POOL SIZE /TOTAL SIZE) "
 1745|       |            "POOL       \"TAG\" <__FILE__:__LINE__> PARENT     (ALLOCS/TOTAL ALLOCS/CLEARS)\n");
 1746|       |
 1747|       |        apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0);
 1748|       |
 1749|       |        /* Add a cleanup handler that sets the debug log file handle
 1750|       |         * to NULL, otherwise we'll try to log the global pool
 1751|       |         * destruction event with predictably disastrous results. */
 1752|       |        apr_pool_cleanup_register(global_pool, NULL,
 1753|       |                                  apr_pool_cleanup_file_stderr,
 1754|       |                                  apr_pool_cleanup_null);
 1755|       |    }
 1756|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1757|       |
 1758|  1.26k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
 1759|  1.26k|}
apr_pool_terminate:
 1762|  1.26k|{
 1763|  1.26k|    if (!apr_pools_initialized)
  ------------------
  |  Branch (1763:9): [True: 0, False: 1.26k]
  ------------------
 1764|      0|        return;
 1765|       |
 1766|  1.26k|    if (--apr_pools_initialized)
  ------------------
  |  Branch (1766:9): [True: 0, False: 1.26k]
  ------------------
 1767|      0|        return;
 1768|       |
 1769|  1.26k|    apr_pool_destroy(global_pool); /* This will also destroy the mutex */
  ------------------
  |  |  388|  1.26k|    apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.26k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.26k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.26k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1770|  1.26k|    global_pool = NULL;
 1771|       |
 1772|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1773|       |    file_stderr = NULL;
 1774|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1775|  1.26k|}
apr_palloc_debug:
 1823|  27.0k|{
 1824|  27.0k|    void *mem;
 1825|       |
 1826|  27.0k|    apr_pool_check_integrity(pool);
 1827|       |
 1828|  27.0k|    mem = pool_alloc(pool, size);
 1829|       |
 1830|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC)
 1831|       |    apr_pool_log_event(pool, "PALLOC", file_line, 1);
 1832|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */
 1833|       |
 1834|  27.0k|    return mem;
 1835|  27.0k|}
apr_pcalloc_debug:
 1839|  2.78k|{
 1840|  2.78k|    void *mem;
 1841|       |
 1842|  2.78k|    apr_pool_check_integrity(pool);
 1843|       |
 1844|  2.78k|    mem = pool_alloc(pool, size);
 1845|  2.78k|    memset(mem, 0, size);
 1846|       |
 1847|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC)
 1848|       |    apr_pool_log_event(pool, "PCALLOC", file_line, 1);
 1849|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */
 1850|       |
 1851|  2.78k|    return mem;
 1852|  2.78k|}
apr_pool_destroy_debug:
 1985|  1.26k|{
 1986|  1.26k|#if APR_HAS_THREADS
 1987|  1.26k|    apr_thread_mutex_t *mutex;
 1988|  1.26k|#endif
 1989|       |
 1990|  1.26k|    apr_pool_check_lifetime(pool);
 1991|       |
 1992|  1.26k|    if (pool->joined) {
  ------------------
  |  Branch (1992:9): [True: 0, False: 1.26k]
  ------------------
 1993|       |        /* Joined pools must not be explicitly destroyed; the caller
 1994|       |         * has broken the guarantee. */
 1995|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1996|       |        apr_pool_log_event(pool, "LIFE",
 1997|       |                           __FILE__ ":apr_pool_destroy abort on joined", 0);
 1998|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1999|       |
 2000|      0|        abort();
 2001|      0|    }
 2002|       |
 2003|  1.26k|#if APR_HAS_THREADS
 2004|       |    /* Lock the parent mutex before destroying so that it's not accessed
 2005|       |     * concurrently by apr_pool_walk_tree.
 2006|       |     */
 2007|  1.26k|    mutex = parent_lock(pool);
 2008|  1.26k|#endif
 2009|       |
 2010|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 2011|       |    apr_pool_log_event(pool, "DESTROY", file_line, 1);
 2012|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 2013|       |
 2014|  1.26k|    pool_destroy_debug(pool, file_line);
 2015|       |
 2016|  1.26k|#if APR_HAS_THREADS
 2017|       |    /* Unlock the mutex we obtained above */
 2018|  1.26k|    parent_unlock(mutex);
 2019|  1.26k|#endif /* APR_HAS_THREADS */
 2020|  1.26k|}
apr_pool_create_ex_debug:
 2027|  2.52k|{
 2028|  2.52k|    apr_pool_t *pool;
 2029|       |
 2030|  2.52k|    *newpool = NULL;
 2031|       |
 2032|  2.52k|    if (!parent) {
  ------------------
  |  Branch (2032:9): [True: 2.52k, False: 0]
  ------------------
 2033|  2.52k|        parent = global_pool;
 2034|  2.52k|    }
 2035|      0|    else {
 2036|      0|       apr_pool_check_lifetime(parent);
 2037|       |
 2038|      0|       if (!allocator)
  ------------------
  |  Branch (2038:12): [True: 0, False: 0]
  ------------------
 2039|      0|           allocator = parent->allocator;
 2040|      0|    }
 2041|       |
 2042|  2.52k|    if (!abort_fn && parent)
  ------------------
  |  Branch (2042:9): [True: 2.52k, False: 0]
  |  Branch (2042:22): [True: 1.26k, False: 1.26k]
  ------------------
 2043|  1.26k|        abort_fn = parent->abort_fn;
 2044|       |
 2045|  2.52k|    if ((pool = malloc(SIZEOF_POOL_T)) == NULL) {
  ------------------
  |  |  618|  2.52k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  143|  2.52k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.52k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2045:9): [True: 0, False: 2.52k]
  ------------------
 2046|      0|        if (abort_fn)
  ------------------
  |  Branch (2046:13): [True: 0, False: 0]
  ------------------
 2047|      0|            abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2048|       |
 2049|      0|         return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2050|      0|    }
 2051|       |
 2052|  2.52k|    memset(pool, 0, SIZEOF_POOL_T);
  ------------------
  |  |  618|  2.52k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  143|  2.52k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.52k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2053|       |
 2054|  2.52k|    pool->allocator = allocator;
 2055|  2.52k|    pool->abort_fn = abort_fn;
 2056|  2.52k|    pool->tag = file_line;
 2057|  2.52k|    pool->file_line = file_line;
 2058|       |
 2059|  2.52k|#if APR_HAS_THREADS
 2060|  2.52k|    if (parent == NULL || parent->allocator != allocator) {
  ------------------
  |  Branch (2060:9): [True: 1.26k, False: 1.26k]
  |  Branch (2060:27): [True: 0, False: 1.26k]
  ------------------
 2061|  1.26k|        apr_status_t rv;
 2062|       |
 2063|       |        /* No matter what the creation flags say, always create
 2064|       |         * a lock.  Without it integrity_check and apr_pool_num_bytes
 2065|       |         * blow up (because they traverse pools child lists that
 2066|       |         * possibly belong to another thread, in combination with
 2067|       |         * the pool having no lock).  However, this might actually
 2068|       |         * hide problems like creating a child pool of a pool
 2069|       |         * belonging to another thread.
 2070|       |         */
 2071|  1.26k|        if ((rv = apr_thread_mutex_create(&pool->mutex,
  ------------------
  |  Branch (2071:13): [True: 0, False: 1.26k]
  ------------------
 2072|  1.26k|                APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |   44|  1.26k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
                              APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.26k|#define APR_SUCCESS 0
  ------------------
 2073|      0|            free(pool);
 2074|      0|            return rv;
 2075|      0|        }
 2076|  1.26k|    }
 2077|  1.26k|    else {
 2078|  1.26k|        pool->mutex = parent->mutex;
 2079|  1.26k|    }
 2080|  2.52k|#endif /* APR_HAS_THREADS */
 2081|       |
 2082|  2.52k|    if ((pool->parent = parent) != NULL) {
  ------------------
  |  Branch (2082:9): [True: 1.26k, False: 1.26k]
  ------------------
 2083|  1.26k|        pool_lock(parent);
 2084|       |
 2085|  1.26k|        if ((pool->sibling = parent->child) != NULL)
  ------------------
  |  Branch (2085:13): [True: 0, False: 1.26k]
  ------------------
 2086|      0|            pool->sibling->ref = &pool->sibling;
 2087|       |
 2088|  1.26k|        parent->child = pool;
 2089|  1.26k|        pool->ref = &parent->child;
 2090|       |
 2091|  1.26k|        pool_unlock(parent);
 2092|  1.26k|    }
 2093|  1.26k|    else {
 2094|  1.26k|        pool->sibling = NULL;
 2095|  1.26k|        pool->ref = NULL;
 2096|  1.26k|    }
 2097|       |
 2098|  2.52k|#if APR_HAS_THREADS
 2099|  2.52k|    pool->owner = apr_os_thread_current();
 2100|  2.52k|#endif /* APR_HAS_THREADS */
 2101|       |#ifdef NETWARE
 2102|       |    pool->owner_proc = (apr_os_proc_t)getnlmhandle();
 2103|       |#endif /* defined(NETWARE) */
 2104|       |
 2105|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 2106|       |    apr_pool_log_event(pool, "CREATE", file_line, 1);
 2107|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 2108|       |
 2109|  2.52k|    *newpool = pool;
 2110|       |
 2111|  2.52k|    return APR_SUCCESS;
  ------------------
  |  |  225|  2.52k|#define APR_SUCCESS 0
  ------------------
 2112|  2.52k|}
apr_pvsprintf:
 2212|  1.01k|{
 2213|  1.01k|    struct psprintf_data ps;
 2214|  1.01k|    debug_node_t *node;
 2215|       |
 2216|  1.01k|    apr_pool_check_integrity(pool);
 2217|       |
 2218|  1.01k|    ps.size = 64;
 2219|  1.01k|    ps.mem = malloc(ps.size);
 2220|  1.01k|    ps.vbuff.curpos  = ps.mem;
 2221|       |
 2222|       |    /* Save a byte for the NUL terminator */
 2223|  1.01k|    ps.vbuff.endpos = ps.mem + ps.size - 1;
 2224|       |
 2225|  1.01k|    if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) {
  ------------------
  |  Branch (2225:9): [True: 0, False: 1.01k]
  ------------------
 2226|      0|        if (pool->abort_fn)
  ------------------
  |  Branch (2226:13): [True: 0, False: 0]
  ------------------
 2227|      0|            pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2228|       |
 2229|      0|        return NULL;
 2230|      0|    }
 2231|       |
 2232|  1.01k|    *ps.vbuff.curpos++ = '\0';
 2233|       |
 2234|       |    /*
 2235|       |     * Link the node in
 2236|       |     */
 2237|  1.01k|    node = pool->nodes;
 2238|  1.01k|    if (node == NULL || node->index == 64) {
  ------------------
  |  Branch (2238:9): [True: 0, False: 1.01k]
  |  Branch (2238:25): [True: 0, False: 1.01k]
  ------------------
 2239|      0|        if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) {
  ------------------
  |  |  562|      0|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  143|      0|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|      0|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2239:13): [True: 0, False: 0]
  ------------------
 2240|      0|            if (pool->abort_fn)
  ------------------
  |  Branch (2240:17): [True: 0, False: 0]
  ------------------
 2241|      0|                pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2242|       |
 2243|      0|            return NULL;
 2244|      0|        }
 2245|       |
 2246|      0|        node->next = pool->nodes;
 2247|      0|        pool->nodes = node;
 2248|      0|        node->index = 0;
 2249|      0|    }
 2250|       |
 2251|  1.01k|    node->beginp[node->index] = ps.mem;
 2252|  1.01k|    node->endp[node->index] = ps.mem + ps.size;
 2253|  1.01k|    node->index++;
 2254|       |
 2255|  1.01k|    return ps.mem;
 2256|  1.01k|}
apr_psprintf:
 2371|  1.01k|{
 2372|  1.01k|    va_list ap;
 2373|  1.01k|    char *res;
 2374|       |
 2375|  1.01k|    va_start(ap, fmt);
 2376|  1.01k|    res = apr_pvsprintf(p, fmt, ap);
 2377|  1.01k|    va_end(ap);
 2378|  1.01k|    return res;
 2379|  1.01k|}
apr_pool_tag:
 2440|  1.26k|{
 2441|  1.26k|    pool->tag = tag;
 2442|  1.26k|}
apr_pool_cleanup_register:
 2530|  2.52k|{
 2531|  2.52k|    cleanup_t *c = NULL;
 2532|       |
 2533|  2.52k|#if APR_POOL_DEBUG
 2534|  2.52k|    apr_pool_check_integrity(p);
 2535|  2.52k|#endif /* APR_POOL_DEBUG */
 2536|       |
 2537|  2.52k|    if (p != NULL) {
  ------------------
  |  Branch (2537:9): [True: 2.52k, False: 0]
  ------------------
 2538|  2.52k|        if (p->free_cleanups) {
  ------------------
  |  Branch (2538:13): [True: 0, False: 2.52k]
  ------------------
 2539|       |            /* reuse a cleanup structure */
 2540|      0|            c = p->free_cleanups;
 2541|      0|            p->free_cleanups = c->next;
 2542|  2.52k|        } else {
 2543|  2.52k|            c = apr_palloc(p, sizeof(cleanup_t));
  ------------------
  |  |  425|  2.52k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  2.52k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.52k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  2.52k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2544|  2.52k|        }
 2545|  2.52k|        c->data = data;
 2546|  2.52k|        c->plain_cleanup_fn = plain_cleanup_fn;
 2547|  2.52k|        c->child_cleanup_fn = child_cleanup_fn;
 2548|  2.52k|        c->next = p->cleanups;
 2549|  2.52k|        p->cleanups = c;
 2550|  2.52k|    }
 2551|       |
 2552|  2.52k|#if APR_POOL_DEBUG
 2553|  2.52k|    if (!c || !c->plain_cleanup_fn || !c->child_cleanup_fn) {
  ------------------
  |  Branch (2553:9): [True: 0, False: 2.52k]
  |  Branch (2553:15): [True: 0, False: 2.52k]
  |  Branch (2553:39): [True: 0, False: 2.52k]
  ------------------
 2554|      0|        abort();
 2555|      0|    }
 2556|  2.52k|#endif /* APR_POOL_DEBUG */
 2557|  2.52k|}
apr_pool_create_ex:
 2979|  1.26k|{
 2980|  1.26k|    return apr_pool_create_ex_debug(newpool, parent,
 2981|  1.26k|                                    abort_fn, allocator,
 2982|  1.26k|                                    "undefined");
 2983|  1.26k|}
apr_pools.c:apr_pool_check_integrity:
 1657|  33.3k|{
 1658|  33.3k|    apr_pool_check_lifetime(pool);
 1659|  33.3k|    apr_pool_check_owner(pool);
 1660|  33.3k|}
apr_pools.c:apr_pool_check_owner:
 1642|  35.8k|{
 1643|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER)
 1644|       |#if APR_HAS_THREADS
 1645|       |    if (!apr_os_thread_equal(pool->owner, apr_os_thread_current())) {
 1646|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1647|       |        apr_pool_log_event(pool, "THREAD",
 1648|       |                           __FILE__ ":apr_pool_integrity check [owner]", 0);
 1649|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1650|       |        abort();
 1651|       |    }
 1652|       |#endif /* APR_HAS_THREADS */
 1653|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) */
 1654|  35.8k|}
apr_pools.c:pool_alloc:
 1783|  29.8k|{
 1784|  29.8k|    debug_node_t *node;
 1785|  29.8k|    void *mem;
 1786|       |
 1787|  29.8k|    if ((mem = malloc(size)) == NULL) {
  ------------------
  |  Branch (1787:9): [True: 0, False: 29.8k]
  ------------------
 1788|      0|        if (pool->abort_fn)
  ------------------
  |  Branch (1788:13): [True: 0, False: 0]
  ------------------
 1789|      0|            pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 1790|       |
 1791|      0|        return NULL;
 1792|      0|    }
 1793|       |
 1794|  29.8k|    node = pool->nodes;
 1795|  29.8k|    if (node == NULL || node->index == 64) {
  ------------------
  |  Branch (1795:9): [True: 2.52k, False: 27.2k]
  |  Branch (1795:25): [True: 4, False: 27.2k]
  ------------------
 1796|  2.53k|        if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) {
  ------------------
  |  |  562|  2.53k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  143|  2.53k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.53k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1796:13): [True: 0, False: 2.53k]
  ------------------
 1797|      0|            free(mem);
 1798|      0|            if (pool->abort_fn)
  ------------------
  |  Branch (1798:17): [True: 0, False: 0]
  ------------------
 1799|      0|                pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 1800|       |
 1801|      0|            return NULL;
 1802|      0|        }
 1803|       |
 1804|  2.53k|        memset(node, 0, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.53k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  143|  2.53k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.53k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1805|       |
 1806|  2.53k|        node->next = pool->nodes;
 1807|  2.53k|        pool->nodes = node;
 1808|  2.53k|        node->index = 0;
 1809|  2.53k|    }
 1810|       |
 1811|  29.8k|    node->beginp[node->index] = mem;
 1812|  29.8k|    node->endp[node->index] = (char *)mem + size;
 1813|  29.8k|    node->index++;
 1814|       |
 1815|  29.8k|    pool->stat_alloc++;
 1816|  29.8k|    pool->stat_total_alloc++;
 1817|       |
 1818|  29.8k|    return mem;
 1819|  29.8k|}
apr_pools.c:apr_pool_check_lifetime:
 1616|  34.6k|{
 1617|       |    /* Rule of thumb: use of the global pool is always
 1618|       |     * ok, since the only user is apr_pools.c.  Unless
 1619|       |     * people have searched for the top level parent and
 1620|       |     * started to use that...
 1621|       |     */
 1622|  34.6k|    if (pool == global_pool || global_pool == NULL)
  ------------------
  |  Branch (1622:9): [True: 1.26k, False: 33.3k]
  |  Branch (1622:32): [True: 3.79k, False: 29.5k]
  ------------------
 1623|  5.05k|        return;
 1624|       |
 1625|       |    /* Lifetime
 1626|       |     * This basically checks to see if the pool being used is still
 1627|       |     * a relative to the global pool.  If not it was previously
 1628|       |     * destroyed, in which case we abort().
 1629|       |     */
 1630|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME)
 1631|       |    if (!apr_pool_is_child_of(pool, global_pool)) {
 1632|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1633|       |        apr_pool_log_event(pool, "LIFE",
 1634|       |                           __FILE__ ":apr_pool_integrity check [lifetime]", 0);
 1635|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1636|       |        abort();
 1637|       |    }
 1638|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */
 1639|  34.6k|}
apr_pools.c:parent_lock:
 1491|  1.26k|{
 1492|  1.26k|    if (pool->parent) {
  ------------------
  |  Branch (1492:9): [True: 0, False: 1.26k]
  ------------------
 1493|      0|        apr_thread_mutex_lock(pool->parent->mutex);
 1494|      0|        return pool->parent->mutex;
 1495|      0|    }
 1496|  1.26k|    return NULL;
 1497|  1.26k|}
apr_pools.c:pool_clear_debug:
 1862|  2.52k|{
 1863|  2.52k|    debug_node_t *node;
 1864|  2.52k|    apr_size_t index;
 1865|       |
 1866|       |    /* Run pre destroy cleanups */
 1867|  2.52k|    run_cleanups(&pool->pre_cleanups);
 1868|  2.52k|    pool->pre_cleanups = NULL;
 1869|       |
 1870|       |    /*
 1871|       |     * Now that we have given the pre cleanups the chance to kill of any
 1872|       |     * threads using the pool, the owner must be correct.
 1873|       |     */
 1874|  2.52k|    apr_pool_check_owner(pool);
 1875|       |
 1876|       |    /* Destroy the subpools.  The subpools will detach themselves from
 1877|       |     * this pool thus this loop is safe and easy.
 1878|       |     */
 1879|  3.79k|    while (pool->child)
  ------------------
  |  Branch (1879:12): [True: 1.26k, False: 2.52k]
  ------------------
 1880|  1.26k|        pool_destroy_debug(pool->child, file_line);
 1881|       |
 1882|       |    /* Run cleanups */
 1883|  2.52k|    run_cleanups(&pool->cleanups);
 1884|  2.52k|    pool->free_cleanups = NULL;
 1885|  2.52k|    pool->cleanups = NULL;
 1886|       |
 1887|       |    /* If new child pools showed up, this is a reason to raise a flag */
 1888|  2.52k|    if (pool->child)
  ------------------
  |  Branch (1888:9): [True: 0, False: 2.52k]
  ------------------
 1889|      0|        abort();
 1890|       |
 1891|       |    /* Free subprocesses */
 1892|  2.52k|    free_proc_chain(pool->subprocesses);
 1893|  2.52k|    pool->subprocesses = NULL;
 1894|       |
 1895|       |    /* Clear the user data. */
 1896|  2.52k|    pool->user_data = NULL;
 1897|       |
 1898|       |    /* Free the blocks, scribbling over them first to help highlight
 1899|       |     * use-after-free issues. */
 1900|  5.06k|    while ((node = pool->nodes) != NULL) {
  ------------------
  |  Branch (1900:12): [True: 2.53k, False: 2.52k]
  ------------------
 1901|  2.53k|        pool->nodes = node->next;
 1902|       |
 1903|  33.3k|        for (index = 0; index < node->index; index++) {
  ------------------
  |  Branch (1903:25): [True: 30.8k, False: 2.53k]
  ------------------
 1904|  30.8k|            memset(node->beginp[index], POOL_POISON_BYTE,
  ------------------
  |  | 1859|  30.8k|#define POOL_POISON_BYTE 'A'
  ------------------
 1905|  30.8k|                   (char *)node->endp[index] - (char *)node->beginp[index]);
 1906|  30.8k|            free(node->beginp[index]);
 1907|  30.8k|        }
 1908|       |
 1909|  2.53k|        memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  | 1859|  2.53k|#define POOL_POISON_BYTE 'A'
  ------------------
                      memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.53k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  143|  2.53k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.53k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1910|  2.53k|        free(node);
 1911|  2.53k|    }
 1912|       |
 1913|  2.52k|    pool->stat_alloc = 0;
 1914|  2.52k|    pool->stat_clear++;
 1915|       |
 1916|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 1917|       |    apr_pool_log_event(pool, "CLEARED", file_line, 1);
 1918|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 1919|  2.52k|}
apr_pools.c:run_cleanups:
 2684|  5.05k|{
 2685|  5.05k|    cleanup_t *c = *cref;
 2686|       |
 2687|  7.58k|    while (c) {
  ------------------
  |  Branch (2687:12): [True: 2.52k, False: 5.05k]
  ------------------
 2688|  2.52k|        *cref = c->next;
 2689|  2.52k|        (*c->plain_cleanup_fn)((void *)c->data);
 2690|  2.52k|        c = *cref;
 2691|  2.52k|    }
 2692|  5.05k|}
apr_pools.c:free_proc_chain:
 2764|  2.52k|{
 2765|       |    /* Dispose of the subprocesses we've spawned off in the course of
 2766|       |     * whatever it was we're cleaning up now.  This may involve killing
 2767|       |     * some of them off...
 2768|       |     */
 2769|  2.52k|    struct process_chain *pc;
 2770|  2.52k|    int need_timeout = 0;
 2771|  2.52k|    apr_time_t timeout_interval;
 2772|       |
 2773|  2.52k|    if (!procs)
  ------------------
  |  Branch (2773:9): [True: 2.52k, False: 0]
  ------------------
 2774|  2.52k|        return; /* No work.  Whew! */
 2775|       |
 2776|       |    /* First, check to see if we need to do the SIGTERM, sleep, SIGKILL
 2777|       |     * dance with any of the processes we're cleaning up.  If we've got
 2778|       |     * any kill-on-sight subprocesses, ditch them now as well, so they
 2779|       |     * don't waste any more cycles doing whatever it is that they shouldn't
 2780|       |     * be doing anymore.
 2781|       |     */
 2782|       |
 2783|      0|#ifndef NEED_WAITPID
 2784|       |    /* Pick up all defunct processes */
 2785|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2785:22): [True: 0, False: 0]
  ------------------
 2786|      0|        if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE)
  ------------------
  |  |  454|      0|#define APR_CHILD_NOTDONE  (APR_OS_START_STATUS + 6)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2786:13): [True: 0, False: 0]
  ------------------
 2787|      0|            pc->kill_how = APR_KILL_NEVER;
 2788|      0|    }
 2789|      0|#endif /* !defined(NEED_WAITPID) */
 2790|       |
 2791|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2791:22): [True: 0, False: 0]
  ------------------
 2792|      0|#ifndef WIN32
 2793|      0|        if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT)
  ------------------
  |  Branch (2793:13): [True: 0, False: 0]
  ------------------
 2794|      0|            || (pc->kill_how == APR_KILL_ONLY_ONCE)) {
  ------------------
  |  Branch (2794:16): [True: 0, False: 0]
  ------------------
 2795|       |            /*
 2796|       |             * Subprocess may be dead already.  Only need the timeout if not.
 2797|       |             * Note: apr_proc_kill on Windows is TerminateProcess(), which is
 2798|       |             * similar to a SIGKILL, so always give the process a timeout
 2799|       |             * under Windows before killing it.
 2800|       |             */
 2801|      0|            if (apr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (2801:17): [True: 0, False: 0]
  ------------------
 2802|      0|                need_timeout = 1;
 2803|      0|        }
 2804|      0|        else if (pc->kill_how == APR_KILL_ALWAYS) {
  ------------------
  |  Branch (2804:18): [True: 0, False: 0]
  ------------------
 2805|       |#else /* WIN32 knows only one fast, clean method of killing processes today */
 2806|       |        if (pc->kill_how != APR_KILL_NEVER) {
 2807|       |            need_timeout = 1;
 2808|       |            pc->kill_how = APR_KILL_ALWAYS;
 2809|       |#endif
 2810|      0|            apr_proc_kill(pc->proc, SIGKILL);
 2811|      0|        }
 2812|      0|    }
 2813|       |
 2814|       |    /* Sleep only if we have to. The sleep algorithm grows
 2815|       |     * by a factor of two on each iteration. TIMEOUT_INTERVAL
 2816|       |     * is equal to TIMEOUT_USECS / 64.
 2817|       |     */
 2818|      0|    if (need_timeout) {
  ------------------
  |  Branch (2818:9): [True: 0, False: 0]
  ------------------
 2819|      0|        timeout_interval = TIMEOUT_INTERVAL;
  ------------------
  |  |  106|      0|#define TIMEOUT_INTERVAL   46875
  ------------------
 2820|      0|        apr_sleep(timeout_interval);
 2821|       |
 2822|      0|        do {
 2823|       |            /* check the status of the subprocesses */
 2824|      0|            need_timeout = 0;
 2825|      0|            for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2825:30): [True: 0, False: 0]
  ------------------
 2826|      0|                if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) {
  ------------------
  |  Branch (2826:21): [True: 0, False: 0]
  ------------------
 2827|      0|                    if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT)
  ------------------
  |  Branch (2827:25): [True: 0, False: 0]
  ------------------
 2828|      0|                            == APR_CHILD_NOTDONE)
  ------------------
  |  |  454|      0|#define APR_CHILD_NOTDONE  (APR_OS_START_STATUS + 6)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2829|      0|                        need_timeout = 1;		/* subprocess is still active */
 2830|      0|                    else
 2831|      0|                        pc->kill_how = APR_KILL_NEVER;	/* subprocess has exited */
 2832|      0|                }
 2833|      0|            }
 2834|      0|            if (need_timeout) {
  ------------------
  |  Branch (2834:17): [True: 0, False: 0]
  ------------------
 2835|      0|                if (timeout_interval >= TIMEOUT_USECS) {
  ------------------
  |  |  105|      0|#define TIMEOUT_USECS    3000000
  ------------------
  |  Branch (2835:21): [True: 0, False: 0]
  ------------------
 2836|      0|                    break;
 2837|      0|                }
 2838|      0|                apr_sleep(timeout_interval);
 2839|      0|                timeout_interval *= 2;
 2840|      0|            }
 2841|      0|        } while (need_timeout);
  ------------------
  |  Branch (2841:18): [True: 0, False: 0]
  ------------------
 2842|      0|    }
 2843|       |
 2844|       |    /* OK, the scripts we just timed out for have had a chance to clean up
 2845|       |     * --- now, just get rid of them, and also clean up the system accounting
 2846|       |     * goop...
 2847|       |     */
 2848|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2848:22): [True: 0, False: 0]
  ------------------
 2849|      0|        if (pc->kill_how == APR_KILL_AFTER_TIMEOUT)
  ------------------
  |  Branch (2849:13): [True: 0, False: 0]
  ------------------
 2850|      0|            apr_proc_kill(pc->proc, SIGKILL);
 2851|      0|    }
 2852|       |
 2853|       |    /* Now wait for all the signaled processes to die */
 2854|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2854:22): [True: 0, False: 0]
  ------------------
 2855|      0|        if (pc->kill_how != APR_KILL_NEVER)
  ------------------
  |  Branch (2855:13): [True: 0, False: 0]
  ------------------
 2856|      0|            (void)apr_proc_wait(pc->proc, NULL, NULL, APR_WAIT);
 2857|      0|    }
 2858|      0|}
apr_pools.c:parent_unlock:
 1501|  1.26k|{
 1502|  1.26k|    if (mutex) {
  ------------------
  |  Branch (1502:9): [True: 0, False: 1.26k]
  ------------------
 1503|      0|        apr_thread_mutex_unlock(mutex);
 1504|      0|    }
 1505|  1.26k|}
apr_pools.c:pool_destroy_debug:
 1964|  2.52k|{
 1965|  2.52k|    pool_clear_debug(pool, file_line);
 1966|       |
 1967|       |    /* Remove the pool from the parent's child list */
 1968|  2.52k|    if (pool->parent != NULL
  ------------------
  |  Branch (1968:9): [True: 1.26k, False: 1.26k]
  ------------------
 1969|  2.52k|        && (*pool->ref = pool->sibling) != NULL) {
  ------------------
  |  Branch (1969:12): [True: 0, False: 1.26k]
  ------------------
 1970|      0|        pool->sibling->ref = pool->ref;
 1971|      0|    }
 1972|       |
 1973|       |    /* Destroy the allocator if the pool owns it */
 1974|  2.52k|    if (pool->allocator != NULL
  ------------------
  |  Branch (1974:9): [True: 0, False: 2.52k]
  ------------------
 1975|  2.52k|        && apr_allocator_owner_get(pool->allocator) == pool) {
  ------------------
  |  Branch (1975:12): [True: 0, False: 0]
  ------------------
 1976|      0|        apr_allocator_destroy(pool->allocator);
 1977|      0|    }
 1978|       |
 1979|       |    /* Free the pool itself */
 1980|  2.52k|    free(pool);
 1981|  2.52k|}
apr_pools.c:pool_lock:
 1474|  1.26k|{
 1475|  1.26k|#if APR_HAS_THREADS
 1476|  1.26k|    apr_thread_mutex_lock(pool->mutex);
 1477|  1.26k|#endif /* APR_HAS_THREADS */
 1478|  1.26k|}
apr_pools.c:pool_unlock:
 1482|  1.26k|{
 1483|  1.26k|#if APR_HAS_THREADS
 1484|  1.26k|    apr_thread_mutex_unlock(pool->mutex);
 1485|  1.26k|#endif /* APR_HAS_THREADS */
 1486|  1.26k|}

apr_vformatter:
  684|  1.01k|{
  685|  1.01k|    register char *sp;
  686|  1.01k|    register char *bep;
  687|  1.01k|    register int cc = 0;
  688|  1.01k|    register apr_size_t i;
  689|       |
  690|  1.01k|    register char *s = NULL;
  691|  1.01k|    char *q;
  692|  1.01k|    apr_size_t s_len = 0;
  693|       |
  694|  1.01k|    register apr_size_t min_width = 0;
  695|  1.01k|    apr_size_t precision = 0;
  696|  1.01k|    enum {
  697|  1.01k|        LEFT, RIGHT
  698|  1.01k|    } adjust;
  699|  1.01k|    char pad_char;
  700|  1.01k|    char prefix_char;
  701|       |
  702|  1.01k|    double fp_num;
  703|  1.01k|    apr_int64_t i_quad = 0;
  704|  1.01k|    apr_uint64_t ui_quad;
  705|  1.01k|    apr_int32_t i_num = 0;
  706|  1.01k|    apr_uint32_t ui_num = 0;
  707|       |
  708|  1.01k|    char num_buf[NUM_BUF_SIZE];
  709|  1.01k|    char char_buf[2];                /* for printing %% and %<unknown> */
  710|       |
  711|  1.01k|    enum var_type_enum {
  712|  1.01k|            IS_QUAD, IS_LONG, IS_SHORT, IS_INT
  713|  1.01k|    };
  714|  1.01k|    enum var_type_enum var_type = IS_INT;
  715|       |
  716|       |    /*
  717|       |     * Flag variables
  718|       |     */
  719|  1.01k|    boolean_e alternate_form;
  720|  1.01k|    boolean_e print_sign;
  721|  1.01k|    boolean_e print_blank;
  722|  1.01k|    boolean_e adjust_precision;
  723|  1.01k|    boolean_e adjust_width;
  724|  1.01k|    int is_negative;
  725|       |
  726|  1.01k|    sp = vbuff->curpos;
  727|  1.01k|    bep = vbuff->endpos;
  728|       |
  729|  36.5k|    while (*fmt) {
  ------------------
  |  Branch (729:12): [True: 35.5k, False: 1.01k]
  ------------------
  730|  35.5k|        if (*fmt != '%') {
  ------------------
  |  Branch (730:13): [True: 34.5k, False: 1.01k]
  ------------------
  731|  34.5k|            INS_CHAR(*fmt, sp, bep, cc);
  ------------------
  |  |  244|  34.5k|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  245|  34.5k|{                                                   \
  |  |  246|  34.5k|    if (sp) {                                       \
  |  |  ------------------
  |  |  |  Branch (246:9): [True: 34.5k, False: 0]
  |  |  ------------------
  |  |  247|  34.5k|        if (sp >= bep) {                            \
  |  |  ------------------
  |  |  |  Branch (247:13): [True: 0, False: 34.5k]
  |  |  ------------------
  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  ------------------
  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  250|      0|                return -1;                          \
  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  253|      0|        }                                           \
  |  |  254|  34.5k|        *sp++ = (c);                                \
  |  |  255|  34.5k|    }                                               \
  |  |  256|  34.5k|    cc++;                                           \
  |  |  257|  34.5k|}
  ------------------
  732|  34.5k|        }
  733|  1.01k|        else {
  734|       |            /*
  735|       |             * Default variable settings
  736|       |             */
  737|  1.01k|            boolean_e print_something = YES;
  738|  1.01k|            adjust = RIGHT;
  739|  1.01k|            alternate_form = print_sign = print_blank = NO;
  740|  1.01k|            pad_char = ' ';
  741|  1.01k|            prefix_char = NUL;
  ------------------
  |  |   55|  1.01k|#define NUL '\0'
  ------------------
  742|       |
  743|  1.01k|            fmt++;
  744|       |
  745|       |            /*
  746|       |             * Try to avoid checking for flags, width or precision
  747|       |             */
  748|  1.01k|            if (!apr_islower(*fmt)) {
  ------------------
  |  |  213|  1.01k|#define apr_islower(c) (islower(((unsigned char)(c))))
  ------------------
  |  Branch (748:17): [True: 1.01k, False: 0]
  ------------------
  749|       |                /*
  750|       |                 * Recognize flags: -, #, BLANK, +
  751|       |                 */
  752|  1.01k|                for (;; fmt++) {
  753|  1.01k|                    if (*fmt == '-')
  ------------------
  |  Branch (753:25): [True: 0, False: 1.01k]
  ------------------
  754|      0|                        adjust = LEFT;
  755|  1.01k|                    else if (*fmt == '+')
  ------------------
  |  Branch (755:30): [True: 0, False: 1.01k]
  ------------------
  756|      0|                        print_sign = YES;
  757|  1.01k|                    else if (*fmt == '#')
  ------------------
  |  Branch (757:30): [True: 0, False: 1.01k]
  ------------------
  758|      0|                        alternate_form = YES;
  759|  1.01k|                    else if (*fmt == ' ')
  ------------------
  |  Branch (759:30): [True: 0, False: 1.01k]
  ------------------
  760|      0|                        print_blank = YES;
  761|  1.01k|                    else if (*fmt == '0')
  ------------------
  |  Branch (761:30): [True: 0, False: 1.01k]
  ------------------
  762|      0|                        pad_char = '0';
  763|  1.01k|                    else
  764|  1.01k|                        break;
  765|  1.01k|                }
  766|       |
  767|       |                /*
  768|       |                 * Check if a width was specified
  769|       |                 */
  770|  1.01k|                if (apr_isdigit(*fmt)) {
  ------------------
  |  |  209|  1.01k|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (209:24): [True: 0, False: 1.01k]
  |  |  ------------------
  ------------------
  771|      0|                    STR_TO_DEC(fmt, min_width);
  ------------------
  |  |  262|      0|    num = NUM(*str++);                              \
  |  |  ------------------
  |  |  |  |  259|      0|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  263|      0|    while (apr_isdigit(*str))                       \
  |  |  ------------------
  |  |  |  |  209|      0|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (209:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  264|      0|    {                                               \
  |  |  265|      0|        num *= 10 ;                                 \
  |  |  266|      0|        num += NUM(*str++);                         \
  |  |  ------------------
  |  |  |  |  259|      0|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  267|      0|    }
  ------------------
  772|      0|                    adjust_width = YES;
  773|      0|                }
  774|  1.01k|                else if (*fmt == '*') {
  ------------------
  |  Branch (774:26): [True: 0, False: 1.01k]
  ------------------
  775|      0|                    int v = va_arg(ap, int);
  776|      0|                    fmt++;
  777|      0|                    adjust_width = YES;
  778|      0|                    if (v < 0) {
  ------------------
  |  Branch (778:25): [True: 0, False: 0]
  ------------------
  779|      0|                        adjust = LEFT;
  780|      0|                        min_width = (apr_size_t)(-v);
  781|      0|                    }
  782|      0|                    else
  783|      0|                        min_width = (apr_size_t)v;
  784|      0|                }
  785|  1.01k|                else
  786|  1.01k|                    adjust_width = NO;
  787|       |
  788|       |                /*
  789|       |                 * Check if a precision was specified
  790|       |                 */
  791|  1.01k|                if (*fmt == '.') {
  ------------------
  |  Branch (791:21): [True: 1.01k, False: 0]
  ------------------
  792|  1.01k|                    adjust_precision = YES;
  793|  1.01k|                    fmt++;
  794|  1.01k|                    if (apr_isdigit(*fmt)) {
  ------------------
  |  |  209|  1.01k|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (209:24): [True: 1.01k, False: 0]
  |  |  ------------------
  ------------------
  795|  1.01k|                        STR_TO_DEC(fmt, precision);
  ------------------
  |  |  262|  1.01k|    num = NUM(*str++);                              \
  |  |  ------------------
  |  |  |  |  259|  1.01k|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  263|  1.01k|    while (apr_isdigit(*str))                       \
  |  |  ------------------
  |  |  |  |  209|  1.01k|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (209:24): [True: 0, False: 1.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  264|  1.01k|    {                                               \
  |  |  265|      0|        num *= 10 ;                                 \
  |  |  266|      0|        num += NUM(*str++);                         \
  |  |  ------------------
  |  |  |  |  259|      0|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  267|      0|    }
  ------------------
  796|  1.01k|                    }
  797|      0|                    else if (*fmt == '*') {
  ------------------
  |  Branch (797:30): [True: 0, False: 0]
  ------------------
  798|      0|                        int v = va_arg(ap, int);
  799|      0|                        fmt++;
  800|      0|                        precision = (v < 0) ? 0 : (apr_size_t)v;
  ------------------
  |  Branch (800:37): [True: 0, False: 0]
  ------------------
  801|      0|                    }
  802|      0|                    else
  803|      0|                        precision = 0;
  804|  1.01k|                }
  805|      0|                else
  806|      0|                    adjust_precision = NO;
  807|  1.01k|            }
  808|      0|            else
  809|      0|                adjust_precision = adjust_width = NO;
  810|       |
  811|       |            /*
  812|       |             * Modifier check.  In same cases, APR_OFF_T_FMT can be
  813|       |             * "lld" and APR_INT64_T_FMT can be "ld" (that is, off_t is
  814|       |             * "larger" than int64). Check that case 1st.
  815|       |             * Note that if APR_OFF_T_FMT is "d",
  816|       |             * the first if condition is never true. If APR_INT64_T_FMT
  817|       |             * is "d' then the second if condition is never true.
  818|       |             */
  819|  1.01k|            if ((sizeof(APR_OFF_T_FMT) > sizeof(APR_INT64_T_FMT)) &&
  ------------------
  |  |  596|  1.01k|#define APR_OFF_T_FMT "ld"
  ------------------
                          if ((sizeof(APR_OFF_T_FMT) > sizeof(APR_INT64_T_FMT)) &&
  ------------------
  |  |  602|  1.01k|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (819:17): [Folded - Ignored]
  ------------------
  820|  1.01k|                ((sizeof(APR_OFF_T_FMT) == 4 &&
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (820:19): [Folded - Ignored]
  ------------------
  821|      0|                 fmt[0] == APR_OFF_T_FMT[0] &&
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (821:18): [True: 0, False: 0]
  ------------------
  822|      0|                 fmt[1] == APR_OFF_T_FMT[1]) ||
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (822:18): [True: 0, False: 0]
  ------------------
  823|      0|                (sizeof(APR_OFF_T_FMT) == 3 &&
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (823:18): [Folded - Ignored]
  ------------------
  824|      0|                 fmt[0] == APR_OFF_T_FMT[0]) ||
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (824:18): [True: 0, False: 0]
  ------------------
  825|      0|                (sizeof(APR_OFF_T_FMT) > 4 &&
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (825:18): [Folded - Ignored]
  ------------------
  826|      0|                 strncmp(fmt, APR_OFF_T_FMT,
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (826:18): [True: 0, False: 0]
  ------------------
  827|      0|                         sizeof(APR_OFF_T_FMT) - 2) == 0))) {
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  828|       |                /* Need to account for trailing 'd' and null in sizeof() */
  829|      0|                var_type = IS_QUAD;
  830|      0|                fmt += (sizeof(APR_OFF_T_FMT) - 2);
  ------------------
  |  |  596|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  831|      0|            }
  832|  1.01k|            else if ((sizeof(APR_INT64_T_FMT) == 4 &&
  ------------------
  |  |  602|  1.01k|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (832:23): [Folded - Ignored]
  ------------------
  833|  1.01k|                 fmt[0] == APR_INT64_T_FMT[0] &&
  ------------------
  |  |  602|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (833:18): [True: 0, False: 0]
  ------------------
  834|  1.01k|                 fmt[1] == APR_INT64_T_FMT[1]) ||
  ------------------
  |  |  602|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (834:18): [True: 0, False: 0]
  ------------------
  835|  1.01k|                (sizeof(APR_INT64_T_FMT) == 3 &&
  ------------------
  |  |  602|  1.01k|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (835:18): [Folded - Ignored]
  ------------------
  836|  1.01k|                 fmt[0] == APR_INT64_T_FMT[0]) ||
  ------------------
  |  |  602|  1.01k|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (836:18): [True: 0, False: 1.01k]
  ------------------
  837|  1.01k|                (sizeof(APR_INT64_T_FMT) > 4 &&
  ------------------
  |  |  602|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (837:18): [Folded - Ignored]
  ------------------
  838|      0|                 strncmp(fmt, APR_INT64_T_FMT,
  ------------------
  |  |  602|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (838:18): [True: 0, False: 0]
  ------------------
  839|      0|                         sizeof(APR_INT64_T_FMT) - 2) == 0)) {
  ------------------
  |  |  602|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  840|       |                /* Need to account for trailing 'd' and null in sizeof() */
  841|      0|                var_type = IS_QUAD;
  842|      0|                fmt += (sizeof(APR_INT64_T_FMT) - 2);
  ------------------
  |  |  602|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  843|      0|            }
  844|  1.01k|            else if (*fmt == 'q') {
  ------------------
  |  Branch (844:22): [True: 0, False: 1.01k]
  ------------------
  845|      0|                var_type = IS_QUAD;
  846|      0|                fmt++;
  847|      0|            }
  848|  1.01k|            else if (*fmt == 'l') {
  ------------------
  |  Branch (848:22): [True: 0, False: 1.01k]
  ------------------
  849|      0|                var_type = IS_LONG;
  850|      0|                fmt++;
  851|      0|            }
  852|  1.01k|            else if (*fmt == 'h') {
  ------------------
  |  Branch (852:22): [True: 0, False: 1.01k]
  ------------------
  853|      0|                var_type = IS_SHORT;
  854|      0|                fmt++;
  855|      0|            }
  856|  1.01k|            else {
  857|  1.01k|                var_type = IS_INT;
  858|  1.01k|            }
  859|       |
  860|       |            /*
  861|       |             * Argument extraction and printing.
  862|       |             * First we determine the argument type.
  863|       |             * Then, we convert the argument to a string.
  864|       |             * On exit from the switch, s points to the string that
  865|       |             * must be printed, s_len has the length of the string
  866|       |             * The precision requirements, if any, are reflected in s_len.
  867|       |             *
  868|       |             * NOTE: pad_char may be set to '0' because of the 0 flag.
  869|       |             *   It is reset to ' ' by non-numeric formats
  870|       |             */
  871|  1.01k|            switch (*fmt) {
  872|      0|            case 'u':
  ------------------
  |  Branch (872:13): [True: 0, False: 1.01k]
  ------------------
  873|      0|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (873:21): [True: 0, False: 0]
  ------------------
  874|      0|                    i_quad = va_arg(ap, apr_uint64_t);
  875|      0|                    s = conv_10_quad(i_quad, 1, &is_negative,
  876|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  877|      0|                }
  878|      0|                else {
  879|      0|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (879:25): [True: 0, False: 0]
  ------------------
  880|      0|                        i_num = (apr_int32_t) va_arg(ap, apr_uint32_t);
  881|      0|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (881:30): [True: 0, False: 0]
  ------------------
  882|      0|                        i_num = (apr_int32_t) (unsigned short) va_arg(ap, unsigned int);
  883|      0|                    else
  884|      0|                        i_num = (apr_int32_t) va_arg(ap, unsigned int);
  885|      0|                    s = conv_10(i_num, 1, &is_negative,
  886|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  887|      0|                }
  888|      0|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|      0|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|      0|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        {                                           \
  |  |  285|      0|            *--s = '0';                             \
  |  |  286|      0|            s_len++;                                \
  |  |  287|      0|        }                                           \
  |  |  288|      0|    }
  ------------------
  889|      0|                break;
  890|       |
  891|      0|            case 'd':
  ------------------
  |  Branch (891:13): [True: 0, False: 1.01k]
  ------------------
  892|      0|            case 'i':
  ------------------
  |  Branch (892:13): [True: 0, False: 1.01k]
  ------------------
  893|      0|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (893:21): [True: 0, False: 0]
  ------------------
  894|      0|                    i_quad = va_arg(ap, apr_int64_t);
  895|      0|                    s = conv_10_quad(i_quad, 0, &is_negative,
  896|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  897|      0|                }
  898|      0|                else {
  899|      0|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (899:25): [True: 0, False: 0]
  ------------------
  900|      0|                        i_num = va_arg(ap, apr_int32_t);
  901|      0|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (901:30): [True: 0, False: 0]
  ------------------
  902|      0|                        i_num = (short) va_arg(ap, int);
  903|      0|                    else
  904|      0|                        i_num = va_arg(ap, int);
  905|      0|                    s = conv_10(i_num, 0, &is_negative,
  906|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  907|      0|                }
  908|      0|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|      0|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|      0|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        {                                           \
  |  |  285|      0|            *--s = '0';                             \
  |  |  286|      0|            s_len++;                                \
  |  |  287|      0|        }                                           \
  |  |  288|      0|    }
  ------------------
  909|       |
  910|      0|                if (is_negative)
  ------------------
  |  Branch (910:21): [True: 0, False: 0]
  ------------------
  911|      0|                    prefix_char = '-';
  912|      0|                else if (print_sign)
  ------------------
  |  Branch (912:26): [True: 0, False: 0]
  ------------------
  913|      0|                    prefix_char = '+';
  914|      0|                else if (print_blank)
  ------------------
  |  Branch (914:26): [True: 0, False: 0]
  ------------------
  915|      0|                    prefix_char = ' ';
  916|      0|                break;
  917|       |
  918|       |
  919|      0|            case 'o':
  ------------------
  |  Branch (919:13): [True: 0, False: 1.01k]
  ------------------
  920|      0|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (920:21): [True: 0, False: 0]
  ------------------
  921|      0|                    ui_quad = va_arg(ap, apr_uint64_t);
  922|      0|                    s = conv_p2_quad(ui_quad, 3, *fmt,
  923|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  924|      0|                }
  925|      0|                else {
  926|      0|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (926:25): [True: 0, False: 0]
  ------------------
  927|      0|                        ui_num = va_arg(ap, apr_uint32_t);
  928|      0|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (928:30): [True: 0, False: 0]
  ------------------
  929|      0|                        ui_num = (unsigned short) va_arg(ap, unsigned int);
  930|      0|                    else
  931|      0|                        ui_num = va_arg(ap, unsigned int);
  932|      0|                    s = conv_p2(ui_num, 3, *fmt,
  933|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  934|      0|                }
  935|      0|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|      0|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|      0|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        {                                           \
  |  |  285|      0|            *--s = '0';                             \
  |  |  286|      0|            s_len++;                                \
  |  |  287|      0|        }                                           \
  |  |  288|      0|    }
  ------------------
  936|      0|                if (alternate_form && *s != '0') {
  ------------------
  |  Branch (936:21): [True: 0, False: 0]
  |  Branch (936:39): [True: 0, False: 0]
  ------------------
  937|      0|                    *--s = '0';
  938|      0|                    s_len++;
  939|      0|                }
  940|      0|                break;
  941|       |
  942|       |
  943|  1.01k|            case 'x':
  ------------------
  |  Branch (943:13): [True: 1.01k, False: 0]
  ------------------
  944|  1.01k|            case 'X':
  ------------------
  |  Branch (944:13): [True: 0, False: 1.01k]
  ------------------
  945|  1.01k|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (945:21): [True: 0, False: 1.01k]
  ------------------
  946|      0|                    ui_quad = va_arg(ap, apr_uint64_t);
  947|      0|                    s = conv_p2_quad(ui_quad, 4, *fmt,
  948|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  949|      0|                }
  950|  1.01k|                else {
  951|  1.01k|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (951:25): [True: 0, False: 1.01k]
  ------------------
  952|      0|                        ui_num = va_arg(ap, apr_uint32_t);
  953|  1.01k|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (953:30): [True: 0, False: 1.01k]
  ------------------
  954|      0|                        ui_num = (unsigned short) va_arg(ap, unsigned int);
  955|  1.01k|                    else
  956|  1.01k|                        ui_num = va_arg(ap, unsigned int);
  957|  1.01k|                    s = conv_p2(ui_num, 4, *fmt,
  958|  1.01k|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|  1.01k|#define NUM_BUF_SIZE 512
  ------------------
  959|  1.01k|                }
  960|  1.01k|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|  1.01k|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 1.01k, False: 0]
  |  |  ------------------
  |  |  281|  1.01k|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|  1.01k|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 1.01k, False: 0]
  |  |  ------------------
  |  |  282|  1.01k|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|  1.15k|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 144, False: 1.01k]
  |  |  ------------------
  |  |  284|  1.01k|        {                                           \
  |  |  285|    144|            *--s = '0';                             \
  |  |  286|    144|            s_len++;                                \
  |  |  287|    144|        }                                           \
  |  |  288|  1.01k|    }
  ------------------
  961|  1.01k|                if (alternate_form && ui_num != 0) {
  ------------------
  |  Branch (961:21): [True: 0, False: 1.01k]
  |  Branch (961:39): [True: 0, False: 0]
  ------------------
  962|      0|                    *--s = *fmt;        /* 'x' or 'X' */
  963|      0|                    *--s = '0';
  964|      0|                    s_len += 2;
  965|      0|                }
  966|  1.01k|                break;
  967|       |
  968|       |
  969|      0|            case 's':
  ------------------
  |  Branch (969:13): [True: 0, False: 1.01k]
  ------------------
  970|      0|                s = va_arg(ap, char *);
  971|      0|                if (s != NULL) {
  ------------------
  |  Branch (971:21): [True: 0, False: 0]
  ------------------
  972|      0|                    if (!adjust_precision) {
  ------------------
  |  Branch (972:25): [True: 0, False: 0]
  ------------------
  973|      0|                        s_len = strlen(s);
  974|      0|                    }
  975|      0|                    else {
  976|       |                        /* From the C library standard in section 7.9.6.1:
  977|       |                         * ...if the precision is specified, no more then
  978|       |                         * that many characters are written.  If the
  979|       |                         * precision is not specified or is greater
  980|       |                         * than the size of the array, the array shall
  981|       |                         * contain a null character.
  982|       |                         *
  983|       |                         * My reading is is precision is specified and
  984|       |                         * is less then or equal to the size of the
  985|       |                         * array, no null character is required.  So
  986|       |                         * we can't do a strlen.
  987|       |                         *
  988|       |                         * This figures out the length of the string
  989|       |                         * up to the precision.  Once it's long enough
  990|       |                         * for the specified precision, we don't care
  991|       |                         * anymore.
  992|       |                         *
  993|       |                         * NOTE: you must do the length comparison
  994|       |                         * before the check for the null character.
  995|       |                         * Otherwise, you'll check one beyond the
  996|       |                         * last valid character.
  997|       |                         */
  998|      0|                        const char *walk;
  999|       |
 1000|      0|                        for (walk = s, s_len = 0;
 1001|      0|                             (s_len < precision) && (*walk != '\0');
  ------------------
  |  Branch (1001:30): [True: 0, False: 0]
  |  Branch (1001:53): [True: 0, False: 0]
  ------------------
 1002|      0|                             ++walk, ++s_len);
 1003|      0|                    }
 1004|      0|                }
 1005|      0|                else {
 1006|      0|                    s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1007|      0|                    s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1008|      0|                }
 1009|      0|                pad_char = ' ';
 1010|      0|                break;
 1011|       |
 1012|       |
 1013|      0|            case 'f':
  ------------------
  |  Branch (1013:13): [True: 0, False: 1.01k]
  ------------------
 1014|      0|            case 'e':
  ------------------
  |  Branch (1014:13): [True: 0, False: 1.01k]
  ------------------
 1015|      0|            case 'E':
  ------------------
  |  Branch (1015:13): [True: 0, False: 1.01k]
  ------------------
 1016|      0|                fp_num = va_arg(ap, double);
 1017|       |                /*
 1018|       |                 * We use &num_buf[ 1 ], so that we have room for the sign
 1019|       |                 */
 1020|      0|                s = NULL;
 1021|      0|#ifdef HAVE_ISNAN
 1022|      0|                if (isnan(fp_num)) {
 1023|      0|                    s = "nan";
 1024|      0|                    s_len = 3;
 1025|      0|                }
 1026|      0|#endif
 1027|      0|#ifdef HAVE_ISINF
 1028|      0|                if (!s && isinf(fp_num)) {
  ------------------
  |  Branch (1028:21): [True: 0, False: 0]
  ------------------
 1029|      0|                    s = "inf";
 1030|      0|                    s_len = 3;
 1031|      0|                }
 1032|      0|#endif
 1033|      0|                if (!s) {
  ------------------
  |  Branch (1033:21): [True: 0, False: 0]
  ------------------
 1034|      0|                    s = conv_fp(*fmt, fp_num, alternate_form,
 1035|      0|                                (int)((adjust_precision == NO) ? FLOAT_DIGITS : precision),
  ------------------
  |  |   61|      0|#define FLOAT_DIGITS 6
  ------------------
  |  Branch (1035:39): [True: 0, False: 0]
  ------------------
 1036|      0|                                &is_negative, &num_buf[1], &s_len);
 1037|      0|                    if (is_negative)
  ------------------
  |  Branch (1037:25): [True: 0, False: 0]
  ------------------
 1038|      0|                        prefix_char = '-';
 1039|      0|                    else if (print_sign)
  ------------------
  |  Branch (1039:30): [True: 0, False: 0]
  ------------------
 1040|      0|                        prefix_char = '+';
 1041|      0|                    else if (print_blank)
  ------------------
  |  Branch (1041:30): [True: 0, False: 0]
  ------------------
 1042|      0|                        prefix_char = ' ';
 1043|      0|                }
 1044|      0|                break;
 1045|       |
 1046|       |
 1047|      0|            case 'g':
  ------------------
  |  Branch (1047:13): [True: 0, False: 1.01k]
  ------------------
 1048|      0|            case 'G':
  ------------------
  |  Branch (1048:13): [True: 0, False: 1.01k]
  ------------------
 1049|      0|                if (adjust_precision == NO)
  ------------------
  |  Branch (1049:21): [True: 0, False: 0]
  ------------------
 1050|      0|                    precision = FLOAT_DIGITS;
  ------------------
  |  |   61|      0|#define FLOAT_DIGITS 6
  ------------------
 1051|      0|                else if (precision == 0)
  ------------------
  |  Branch (1051:26): [True: 0, False: 0]
  ------------------
 1052|      0|                    precision = 1;
 1053|       |                /*
 1054|       |                 * * We use &num_buf[ 1 ], so that we have room for the sign
 1055|       |                 */
 1056|      0|                s = apr_gcvt(va_arg(ap, double), (int) precision, &num_buf[1],
 1057|      0|                            alternate_form);
 1058|      0|                if (*s == '-')
  ------------------
  |  Branch (1058:21): [True: 0, False: 0]
  ------------------
 1059|      0|                    prefix_char = *s++;
 1060|      0|                else if (print_sign)
  ------------------
  |  Branch (1060:26): [True: 0, False: 0]
  ------------------
 1061|      0|                    prefix_char = '+';
 1062|      0|                else if (print_blank)
  ------------------
  |  Branch (1062:26): [True: 0, False: 0]
  ------------------
 1063|      0|                    prefix_char = ' ';
 1064|       |
 1065|      0|                s_len = strlen(s);
 1066|       |
 1067|      0|                if (alternate_form && (q = strchr(s, '.')) == NULL) {
  ------------------
  |  Branch (1067:21): [True: 0, False: 0]
  |  Branch (1067:39): [True: 0, False: 0]
  ------------------
 1068|      0|                    s[s_len++] = '.';
 1069|      0|                    s[s_len] = '\0'; /* delimit for following strchr() */
 1070|      0|                }
 1071|      0|                if (*fmt == 'G' && (q = strchr(s, 'e')) != NULL)
  ------------------
  |  Branch (1071:21): [True: 0, False: 0]
  |  Branch (1071:36): [True: 0, False: 0]
  ------------------
 1072|      0|                    *q = 'E';
 1073|      0|                break;
 1074|       |
 1075|       |
 1076|      0|            case 'c':
  ------------------
  |  Branch (1076:13): [True: 0, False: 1.01k]
  ------------------
 1077|      0|                char_buf[0] = (char) (va_arg(ap, int));
 1078|      0|                s = &char_buf[0];
 1079|      0|                s_len = 1;
 1080|      0|                pad_char = ' ';
 1081|      0|                break;
 1082|       |
 1083|       |
 1084|      0|            case '%':
  ------------------
  |  Branch (1084:13): [True: 0, False: 1.01k]
  ------------------
 1085|      0|                char_buf[0] = '%';
 1086|      0|                s = &char_buf[0];
 1087|      0|                s_len = 1;
 1088|      0|                pad_char = ' ';
 1089|      0|                break;
 1090|       |
 1091|       |
 1092|      0|            case 'n':
  ------------------
  |  Branch (1092:13): [True: 0, False: 1.01k]
  ------------------
 1093|      0|                if (var_type == IS_QUAD)
  ------------------
  |  Branch (1093:21): [True: 0, False: 0]
  ------------------
 1094|      0|                    *(va_arg(ap, apr_int64_t *)) = cc;
 1095|      0|                else if (var_type == IS_LONG)
  ------------------
  |  Branch (1095:26): [True: 0, False: 0]
  ------------------
 1096|      0|                    *(va_arg(ap, long *)) = cc;
 1097|      0|                else if (var_type == IS_SHORT)
  ------------------
  |  Branch (1097:26): [True: 0, False: 0]
  ------------------
 1098|      0|                    *(va_arg(ap, short *)) = cc;
 1099|      0|                else
 1100|      0|                    *(va_arg(ap, int *)) = cc;
 1101|      0|                print_something = NO;
 1102|      0|                break;
 1103|       |
 1104|       |                /*
 1105|       |                 * This is where we extend the printf format, with a second
 1106|       |                 * type specifier
 1107|       |                 */
 1108|      0|            case 'p':
  ------------------
  |  Branch (1108:13): [True: 0, False: 1.01k]
  ------------------
 1109|      0|                switch(*++fmt) {
 1110|       |                /*
 1111|       |                 * If the pointer size is equal to or smaller than the size
 1112|       |                 * of the largest unsigned int, we convert the pointer to a
 1113|       |                 * hex number, otherwise we print "%p" to indicate that we
 1114|       |                 * don't handle "%p".
 1115|       |                 */
 1116|      0|                case 'p':
  ------------------
  |  Branch (1116:17): [True: 0, False: 0]
  ------------------
 1117|      0|#if APR_SIZEOF_VOIDP == 8
 1118|      0|                    if (sizeof(void *) <= sizeof(apr_uint64_t)) {
  ------------------
  |  Branch (1118:25): [Folded - Ignored]
  ------------------
 1119|      0|                        ui_quad = (apr_uint64_t) va_arg(ap, void *);
 1120|      0|                        s = conv_p2_quad(ui_quad, 4, 'x',
 1121|      0|                                &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1122|      0|                    }
 1123|       |#else
 1124|       |                    if (sizeof(void *) <= sizeof(apr_uint32_t)) {
 1125|       |                        ui_num = (apr_uint32_t) va_arg(ap, void *);
 1126|       |                        s = conv_p2(ui_num, 4, 'x',
 1127|       |                                &num_buf[NUM_BUF_SIZE], &s_len);
 1128|       |                    }
 1129|       |#endif
 1130|      0|                    else {
 1131|      0|                        s = "%p";
 1132|      0|                        s_len = 2;
 1133|      0|                        prefix_char = NUL;
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
 1134|      0|                    }
 1135|      0|                    pad_char = ' ';
 1136|      0|                    break;
 1137|       |
 1138|       |                /* print an apr_sockaddr_t as a.b.c.d:port */
 1139|      0|                case 'I':
  ------------------
  |  Branch (1139:17): [True: 0, False: 0]
  ------------------
 1140|      0|                {
 1141|      0|                    apr_sockaddr_t *sa;
 1142|       |
 1143|      0|                    sa = va_arg(ap, apr_sockaddr_t *);
 1144|      0|                    if (sa != NULL) {
  ------------------
  |  Branch (1144:25): [True: 0, False: 0]
  ------------------
 1145|      0|                        s = conv_apr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1146|      0|                        if (adjust_precision && precision < s_len)
  ------------------
  |  Branch (1146:29): [True: 0, False: 0]
  |  Branch (1146:49): [True: 0, False: 0]
  ------------------
 1147|      0|                            s_len = precision;
 1148|      0|                    }
 1149|      0|                    else {
 1150|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1151|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1152|      0|                    }
 1153|      0|                    pad_char = ' ';
 1154|      0|                }
 1155|      0|                break;
 1156|       |
 1157|       |                /* print a struct in_addr as a.b.c.d */
 1158|      0|                case 'A':
  ------------------
  |  Branch (1158:17): [True: 0, False: 0]
  ------------------
 1159|      0|                {
 1160|      0|                    struct in_addr *ia;
 1161|       |
 1162|      0|                    ia = va_arg(ap, struct in_addr *);
 1163|      0|                    if (ia != NULL) {
  ------------------
  |  Branch (1163:25): [True: 0, False: 0]
  ------------------
 1164|      0|                        s = conv_in_addr(ia, &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1165|      0|                        if (adjust_precision && precision < s_len)
  ------------------
  |  Branch (1165:29): [True: 0, False: 0]
  |  Branch (1165:49): [True: 0, False: 0]
  ------------------
 1166|      0|                            s_len = precision;
 1167|      0|                    }
 1168|      0|                    else {
 1169|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1170|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1171|      0|                    }
 1172|      0|                    pad_char = ' ';
 1173|      0|                }
 1174|      0|                break;
 1175|       |
 1176|       |                /* print the error for an apr_status_t */
 1177|      0|                case 'm':
  ------------------
  |  Branch (1177:17): [True: 0, False: 0]
  ------------------
 1178|      0|                {
 1179|      0|                    apr_status_t *mrv;
 1180|       |
 1181|      0|                    mrv = va_arg(ap, apr_status_t *);
 1182|      0|                    if (mrv != NULL) {
  ------------------
  |  Branch (1182:25): [True: 0, False: 0]
  ------------------
 1183|      0|                        s = apr_strerror(*mrv, num_buf, NUM_BUF_SIZE-1);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1184|      0|                        s_len = strlen(s);
 1185|      0|                    }
 1186|      0|                    else {
 1187|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1188|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1189|      0|                    }
 1190|      0|                    pad_char = ' ';
 1191|      0|                }
 1192|      0|                break;
 1193|       |
 1194|      0|                case 'T':
  ------------------
  |  Branch (1194:17): [True: 0, False: 0]
  ------------------
 1195|      0|#if APR_HAS_THREADS
 1196|      0|                {
 1197|      0|                    apr_os_thread_t *tid;
 1198|       |
 1199|      0|                    tid = va_arg(ap, apr_os_thread_t *);
 1200|      0|                    if (tid != NULL) {
  ------------------
  |  Branch (1200:25): [True: 0, False: 0]
  ------------------
 1201|      0|                        s = conv_os_thread_t(tid, &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1202|      0|                        if (adjust_precision && precision < s_len)
  ------------------
  |  Branch (1202:29): [True: 0, False: 0]
  |  Branch (1202:49): [True: 0, False: 0]
  ------------------
 1203|      0|                            s_len = precision;
 1204|      0|                    }
 1205|      0|                    else {
 1206|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1207|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1208|      0|                    }
 1209|      0|                    pad_char = ' ';
 1210|      0|                }
 1211|       |#else
 1212|       |                    char_buf[0] = '0';
 1213|       |                    s = &char_buf[0];
 1214|       |                    s_len = 1;
 1215|       |                    pad_char = ' ';
 1216|       |#endif
 1217|      0|                    break;
 1218|       |
 1219|      0|                case 't':
  ------------------
  |  Branch (1219:17): [True: 0, False: 0]
  ------------------
 1220|      0|#if APR_HAS_THREADS
 1221|      0|                {
 1222|      0|                    apr_os_thread_t *tid;
 1223|       |
 1224|      0|                    tid = va_arg(ap, apr_os_thread_t *);
 1225|      0|                    if (tid != NULL) {
  ------------------
  |  Branch (1225:25): [True: 0, False: 0]
  ------------------
 1226|      0|                        s = conv_os_thread_t_hex(tid, &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1227|      0|                        if (adjust_precision && precision < s_len)
  ------------------
  |  Branch (1227:29): [True: 0, False: 0]
  |  Branch (1227:49): [True: 0, False: 0]
  ------------------
 1228|      0|                            s_len = precision;
 1229|      0|                    }
 1230|      0|                    else {
 1231|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1232|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1233|      0|                    }
 1234|      0|                    pad_char = ' ';
 1235|      0|                }
 1236|       |#else
 1237|       |                    char_buf[0] = '0';
 1238|       |                    s = &char_buf[0];
 1239|       |                    s_len = 1;
 1240|       |                    pad_char = ' ';
 1241|       |#endif
 1242|      0|                    break;
 1243|       |
 1244|      0|                case 'B':
  ------------------
  |  Branch (1244:17): [True: 0, False: 0]
  ------------------
 1245|      0|                case 'F':
  ------------------
  |  Branch (1245:17): [True: 0, False: 0]
  ------------------
 1246|      0|                case 'S':
  ------------------
  |  Branch (1246:17): [True: 0, False: 0]
  ------------------
 1247|      0|                {
 1248|      0|                    char buf[5];
 1249|      0|                    apr_off_t size = 0;
 1250|       |
 1251|      0|                    if (*fmt == 'B') {
  ------------------
  |  Branch (1251:25): [True: 0, False: 0]
  ------------------
 1252|      0|                        apr_uint32_t *arg = va_arg(ap, apr_uint32_t *);
 1253|      0|                        size = (arg) ? *arg : 0;
  ------------------
  |  Branch (1253:32): [True: 0, False: 0]
  ------------------
 1254|      0|                    }
 1255|      0|                    else if (*fmt == 'F') {
  ------------------
  |  Branch (1255:30): [True: 0, False: 0]
  ------------------
 1256|      0|                        apr_off_t *arg = va_arg(ap, apr_off_t *);
 1257|      0|                        size = (arg) ? *arg : 0;
  ------------------
  |  Branch (1257:32): [True: 0, False: 0]
  ------------------
 1258|      0|                    }
 1259|      0|                    else {
 1260|      0|                        apr_size_t *arg = va_arg(ap, apr_size_t *);
 1261|      0|                        size = (arg) ? *arg : 0;
  ------------------
  |  Branch (1261:32): [True: 0, False: 0]
  ------------------
 1262|      0|                    }
 1263|       |
 1264|      0|                    s = apr_strfsize(size, buf);
 1265|      0|                    s_len = strlen(s);
 1266|      0|                    pad_char = ' ';
 1267|      0|                }
 1268|      0|                break;
 1269|       |
 1270|      0|                case NUL:
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
  |  Branch (1270:17): [True: 0, False: 0]
  ------------------
 1271|       |                    /* if %p ends the string, oh well ignore it */
 1272|      0|                    continue;
 1273|       |
 1274|      0|                default:
  ------------------
  |  Branch (1274:17): [True: 0, False: 0]
  ------------------
 1275|      0|                    s = "bogus %p";
 1276|      0|                    s_len = 8;
 1277|      0|                    prefix_char = NUL;
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
 1278|      0|                    (void)va_arg(ap, void *); /* skip the bogus argument on the stack */
 1279|      0|                    break;
 1280|      0|                }
 1281|      0|                break;
 1282|       |
 1283|      0|            case NUL:
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
  |  Branch (1283:13): [True: 0, False: 1.01k]
  ------------------
 1284|       |                /*
 1285|       |                 * The last character of the format string was %.
 1286|       |                 * We ignore it.
 1287|       |                 */
 1288|      0|                continue;
 1289|       |
 1290|       |
 1291|       |                /*
 1292|       |                 * The default case is for unrecognized %'s.
 1293|       |                 * We print %<char> to help the user identify what
 1294|       |                 * option is not understood.
 1295|       |                 * This is also useful in case the user wants to pass
 1296|       |                 * the output of format_converter to another function
 1297|       |                 * that understands some other %<char> (like syslog).
 1298|       |                 * Note that we can't point s inside fmt because the
 1299|       |                 * unknown <char> could be preceded by width etc.
 1300|       |                 */
 1301|      0|            default:
  ------------------
  |  Branch (1301:13): [True: 0, False: 1.01k]
  ------------------
 1302|      0|                char_buf[0] = '%';
 1303|      0|                char_buf[1] = *fmt;
 1304|      0|                s = char_buf;
 1305|      0|                s_len = 2;
 1306|      0|                pad_char = ' ';
 1307|      0|                break;
 1308|  1.01k|            }
 1309|       |
 1310|  1.01k|            if (prefix_char != NUL && s != S_NULL && s != char_buf) {
  ------------------
  |  |   55|  2.03k|#define NUL '\0'
  ------------------
                          if (prefix_char != NUL && s != S_NULL && s != char_buf) {
  ------------------
  |  |   58|  1.01k|#define S_NULL ((char *)null_string)
  ------------------
  |  Branch (1310:17): [True: 0, False: 1.01k]
  |  Branch (1310:39): [True: 0, False: 0]
  |  Branch (1310:54): [True: 0, False: 0]
  ------------------
 1311|      0|                *--s = prefix_char;
 1312|      0|                s_len++;
 1313|      0|            }
 1314|       |
 1315|  1.01k|            if (adjust_width && adjust == RIGHT && min_width > s_len) {
  ------------------
  |  Branch (1315:17): [True: 0, False: 1.01k]
  |  Branch (1315:33): [True: 0, False: 0]
  |  Branch (1315:52): [True: 0, False: 0]
  ------------------
 1316|      0|                if (pad_char == '0' && prefix_char != NUL) {
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
  |  Branch (1316:21): [True: 0, False: 0]
  |  Branch (1316:40): [True: 0, False: 0]
  ------------------
 1317|      0|                    INS_CHAR(*s, sp, bep, cc);
  ------------------
  |  |  244|      0|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  245|      0|{                                                   \
  |  |  246|      0|    if (sp) {                                       \
  |  |  ------------------
  |  |  |  Branch (246:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  247|      0|        if (sp >= bep) {                            \
  |  |  ------------------
  |  |  |  Branch (247:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  ------------------
  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  250|      0|                return -1;                          \
  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  253|      0|        }                                           \
  |  |  254|      0|        *sp++ = (c);                                \
  |  |  255|      0|    }                                               \
  |  |  256|      0|    cc++;                                           \
  |  |  257|      0|}
  ------------------
 1318|      0|                    s++;
 1319|      0|                    s_len--;
 1320|      0|                    min_width--;
 1321|      0|                }
 1322|      0|                PAD(min_width, s_len, pad_char);
  ------------------
  |  |  294|      0|#define PAD(width, len, ch)                         \
  |  |  295|      0|do                                                  \
  |  |  296|      0|{                                                   \
  |  |  297|      0|    INS_CHAR(ch, sp, bep, cc);                      \
  |  |  ------------------
  |  |  |  |  244|      0|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  |  |  245|      0|{                                                   \
  |  |  |  |  246|      0|    if (sp) {                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (246:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  247|      0|        if (sp >= bep) {                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (247:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  250|      0|                return -1;                          \
  |  |  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  |  |  253|      0|        }                                           \
  |  |  |  |  254|      0|        *sp++ = (c);                                \
  |  |  |  |  255|      0|    }                                               \
  |  |  |  |  256|      0|    cc++;                                           \
  |  |  |  |  257|      0|}
  |  |  ------------------
  |  |  298|      0|    width--;                                        \
  |  |  299|      0|}                                                   \
  |  |  300|      0|while (width > len)
  |  |  ------------------
  |  |  |  Branch (300:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1323|      0|            }
 1324|       |
 1325|       |            /*
 1326|       |             * Print the string s.
 1327|       |             */
 1328|  1.01k|            if (print_something == YES) {
  ------------------
  |  Branch (1328:17): [True: 1.01k, False: 0]
  ------------------
 1329|  3.04k|                for (i = s_len; i != 0; i--) {
  ------------------
  |  Branch (1329:33): [True: 2.03k, False: 1.01k]
  ------------------
 1330|  2.03k|                    INS_CHAR(*s, sp, bep, cc);
  ------------------
  |  |  244|  2.03k|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  245|  2.03k|{                                                   \
  |  |  246|  2.03k|    if (sp) {                                       \
  |  |  ------------------
  |  |  |  Branch (246:9): [True: 2.03k, False: 0]
  |  |  ------------------
  |  |  247|  2.03k|        if (sp >= bep) {                            \
  |  |  ------------------
  |  |  |  Branch (247:13): [True: 0, False: 2.03k]
  |  |  ------------------
  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  ------------------
  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  250|      0|                return -1;                          \
  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  253|      0|        }                                           \
  |  |  254|  2.03k|        *sp++ = (c);                                \
  |  |  255|  2.03k|    }                                               \
  |  |  256|  2.03k|    cc++;                                           \
  |  |  257|  2.03k|}
  ------------------
 1331|  2.03k|                    s++;
 1332|  2.03k|                }
 1333|  1.01k|            }
 1334|       |
 1335|  1.01k|            if (adjust_width && adjust == LEFT && min_width > s_len)
  ------------------
  |  Branch (1335:17): [True: 0, False: 1.01k]
  |  Branch (1335:33): [True: 0, False: 0]
  |  Branch (1335:51): [True: 0, False: 0]
  ------------------
 1336|      0|                PAD(min_width, s_len, pad_char);
  ------------------
  |  |  294|      0|#define PAD(width, len, ch)                         \
  |  |  295|      0|do                                                  \
  |  |  296|      0|{                                                   \
  |  |  297|      0|    INS_CHAR(ch, sp, bep, cc);                      \
  |  |  ------------------
  |  |  |  |  244|      0|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  |  |  245|      0|{                                                   \
  |  |  |  |  246|      0|    if (sp) {                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (246:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  247|      0|        if (sp >= bep) {                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (247:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  250|      0|                return -1;                          \
  |  |  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  |  |  253|      0|        }                                           \
  |  |  |  |  254|      0|        *sp++ = (c);                                \
  |  |  |  |  255|      0|    }                                               \
  |  |  |  |  256|      0|    cc++;                                           \
  |  |  |  |  257|      0|}
  |  |  ------------------
  |  |  298|      0|    width--;                                        \
  |  |  299|      0|}                                                   \
  |  |  300|      0|while (width > len)
  |  |  ------------------
  |  |  |  Branch (300:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1337|  1.01k|        }
 1338|  35.5k|        fmt++;
 1339|  35.5k|    }
 1340|  1.01k|    vbuff->curpos = sp;
 1341|       |
 1342|  1.01k|    return cc;
 1343|  1.01k|}
apr_snprintf.c:conv_p2:
  617|  1.01k|{
  618|  1.01k|    register int mask = (1 << nbits) - 1;
  619|  1.01k|    register char *p = buf_end;
  620|  1.01k|    static const char low_digits[] = "0123456789abcdef";
  621|  1.01k|    static const char upper_digits[] = "0123456789ABCDEF";
  622|  1.01k|    register const char *digits = (format == 'X') ? upper_digits : low_digits;
  ------------------
  |  Branch (622:35): [True: 0, False: 1.01k]
  ------------------
  623|       |
  624|  1.88k|    do {
  625|  1.88k|        *--p = digits[num & mask];
  626|  1.88k|        num >>= nbits;
  627|  1.88k|    }
  628|  1.88k|    while (num);
  ------------------
  |  Branch (628:12): [True: 871, False: 1.01k]
  ------------------
  629|       |
  630|  1.01k|    *len = buf_end - p;
  631|  1.01k|    return (p);
  632|  1.01k|}

apr_pstrdup:
   70|  4.91k|{
   71|  4.91k|    char *res;
   72|  4.91k|    apr_size_t len;
   73|       |
   74|  4.91k|    if (s == NULL) {
  ------------------
  |  Branch (74:9): [True: 0, False: 4.91k]
  ------------------
   75|      0|        return NULL;
   76|      0|    }
   77|  4.91k|    len = strlen(s) + 1;
   78|  4.91k|    res = apr_pmemdup(a, s, len);
   79|  4.91k|    return res;
   80|  4.91k|}
apr_pstrmemdup:
  100|  4.74k|{
  101|  4.74k|    char *res;
  102|       |
  103|  4.74k|    if (s == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 4.74k]
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|  4.74k|    res = apr_palloc(a, n + 1);
  ------------------
  |  |  425|  4.74k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  4.74k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  4.74k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  4.74k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  107|  4.74k|    memcpy(res, s, n);
  108|  4.74k|    res[n] = '\0';
  109|  4.74k|    return res;
  110|  4.74k|}
apr_pmemdup:
  113|  5.16k|{
  114|  5.16k|    void *res;
  115|       |
  116|  5.16k|    if (m == NULL)
  ------------------
  |  Branch (116:9): [True: 0, False: 5.16k]
  ------------------
  117|      0|	return NULL;
  118|  5.16k|    res = apr_palloc(a, n);
  ------------------
  |  |  425|  5.16k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  5.16k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.16k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  5.16k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|  5.16k|    memcpy(res, m, n);
  120|  5.16k|    return res;
  121|  5.16k|}
apr_strtoi64:
  277|  1.26k|{
  278|  1.26k|#ifdef APR_INT64_STRFN
  279|  1.26k|    errno = 0;
  280|  1.26k|    return APR_INT64_STRFN(nptr, endptr, base);
  ------------------
  |  |   31|  1.26k|#define APR_INT64_STRFN strtol
  ------------------
  281|       |#else
  282|       |    const char *s;
  283|       |    apr_int64_t acc;
  284|       |    apr_int64_t val;
  285|       |    int neg, any;
  286|       |    char c;
  287|       |
  288|       |    errno = 0;
  289|       |    /*
  290|       |     * Skip white space and pick up leading +/- sign if any.
  291|       |     * If base is 0, allow 0x for hex and 0 for octal, else
  292|       |     * assume decimal; if base is already 16, allow 0x.
  293|       |     */
  294|       |    s = nptr;
  295|       |    do {
  296|       |	c = *s++;
  297|       |    } while (apr_isspace(c));
  298|       |    if (c == '-') {
  299|       |	neg = 1;
  300|       |	c = *s++;
  301|       |    } else {
  302|       |	neg = 0;
  303|       |	if (c == '+')
  304|       |	    c = *s++;
  305|       |    }
  306|       |    if ((base == 0 || base == 16) &&
  307|       |	c == '0' && (*s == 'x' || *s == 'X')) {
  308|       |	    c = s[1];
  309|       |	    s += 2;
  310|       |	    base = 16;
  311|       |    }
  312|       |    if (base == 0)
  313|       |	base = c == '0' ? 8 : 10;
  314|       |    acc = any = 0;
  315|       |    if (base < 2 || base > 36) {
  316|       |	errno = EINVAL;
  317|       |        if (endptr != NULL)
  318|       |	    *endptr = (char *)(any ? s - 1 : nptr);
  319|       |        return acc;
  320|       |    }
  321|       |
  322|       |    /* The classic bsd implementation requires div/mod operators
  323|       |     * to compute a cutoff.  Benchmarking proves that is very, very
  324|       |     * evil to some 32 bit processors.  Instead, look for underflow
  325|       |     * in both the mult and add/sub operation.  Unlike the bsd impl,
  326|       |     * we also work strictly in a signed int64 word as we haven't
  327|       |     * implemented the unsigned type in win32.
  328|       |     *
  329|       |     * Set 'any' if any `digits' consumed; make it negative to indicate
  330|       |     * overflow.
  331|       |     */
  332|       |    val = 0;
  333|       |    for ( ; ; c = *s++) {
  334|       |        if (c >= '0' && c <= '9')
  335|       |	    c -= '0';
  336|       |#if (('Z' - 'A') == 25)
  337|       |	else if (c >= 'A' && c <= 'Z')
  338|       |	    c -= 'A' - 10;
  339|       |	else if (c >= 'a' && c <= 'z')
  340|       |	    c -= 'a' - 10;
  341|       |#elif APR_CHARSET_EBCDIC
  342|       |	else if (c >= 'A' && c <= 'I')
  343|       |	    c -= 'A' - 10;
  344|       |	else if (c >= 'J' && c <= 'R')
  345|       |	    c -= 'J' - 19;
  346|       |	else if (c >= 'S' && c <= 'Z')
  347|       |	    c -= 'S' - 28;
  348|       |	else if (c >= 'a' && c <= 'i')
  349|       |	    c -= 'a' - 10;
  350|       |	else if (c >= 'j' && c <= 'r')
  351|       |	    c -= 'j' - 19;
  352|       |	else if (c >= 's' && c <= 'z')
  353|       |	    c -= 'z' - 28;
  354|       |#else
  355|       |#error "CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported"
  356|       |#endif
  357|       |	else
  358|       |	    break;
  359|       |	if (c >= base)
  360|       |	    break;
  361|       |	val *= base;
  362|       |        if ( (any < 0)	/* already noted an over/under flow - short circuit */
  363|       |           || (neg && (val > acc || (val -= c) > acc)) /* underflow */
  364|       |           || (!neg && (val < acc || (val += c) < acc))) {       /* overflow */
  365|       |            any = -1;	/* once noted, over/underflows never go away */
  366|       |#ifdef APR_STRTOI64_OVERFLOW_IS_BAD_CHAR
  367|       |            break;
  368|       |#endif
  369|       |        } else {
  370|       |            acc = val;
  371|       |	    any = 1;
  372|       |        }
  373|       |    }
  374|       |
  375|       |    if (any < 0) {
  376|       |	acc = neg ? INT64_MIN : INT64_MAX;
  377|       |	errno = ERANGE;
  378|       |    } else if (!any) {
  379|       |	errno = EINVAL;
  380|       |    }
  381|       |    if (endptr != NULL)
  382|       |	*endptr = (char *)(any ? s - 1 : nptr);
  383|       |    return (acc);
  384|       |#endif
  385|  1.26k|}

apr_array_make:
   85|    261|{
   86|    261|    apr_array_header_t *res;
   87|       |
   88|    261|    res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t));
  ------------------
  |  |  425|    261|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    261|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    261|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    261|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|    261|    make_array_core(res, p, nelts, elt_size, 1);
   90|    261|    return res;
   91|    261|}
apr_array_push:
  108|  1.01k|{
  109|  1.01k|    if (arr->nelts == arr->nalloc) {
  ------------------
  |  Branch (109:9): [True: 94, False: 916]
  ------------------
  110|     94|        int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2;
  ------------------
  |  Branch (110:24): [True: 0, False: 94]
  ------------------
  111|     94|        char *new_data;
  112|       |
  113|     94|        new_data = apr_palloc(arr->pool, arr->elt_size * new_size);
  ------------------
  |  |  425|     94|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     94|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|     94|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|     94|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|       |
  115|     94|        memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size);
  116|     94|        memset(new_data + arr->nalloc * arr->elt_size, 0,
  117|     94|               arr->elt_size * (new_size - arr->nalloc));
  118|     94|        arr->elts = new_data;
  119|     94|        arr->nalloc = new_size;
  120|     94|    }
  121|       |
  122|  1.01k|    ++arr->nelts;
  123|  1.01k|    return arr->elts + (arr->elt_size * (arr->nelts - 1));
  124|  1.01k|}
apr_tables.c:make_array_core:
   56|    261|{
   57|       |    /*
   58|       |     * Assure sanity if someone asks for
   59|       |     * array of zero elts.
   60|       |     */
   61|    261|    if (nelts < 1) {
  ------------------
  |  Branch (61:9): [True: 0, False: 261]
  ------------------
   62|      0|        nelts = 1;
   63|      0|    }
   64|       |
   65|    261|    if (clear) {
  ------------------
  |  Branch (65:9): [True: 261, False: 0]
  ------------------
   66|    261|        res->elts = apr_pcalloc(p, nelts * elt_size);
  ------------------
  |  |  454|    261|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    261|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    261|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    261|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   67|    261|    }
   68|      0|    else {
   69|      0|        res->elts = apr_palloc(p, nelts * elt_size);
  ------------------
  |  |  425|      0|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|      0|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   70|      0|    }
   71|       |
   72|    261|    res->pool = p;
   73|    261|    res->elt_size = elt_size;
   74|    261|    res->nelts = 0;		/* No active elements yet... */
   75|    261|    res->nalloc = nelts;	/* ...but this many allocated */
   76|    261|}

apr_os_thread_current:
  340|  2.52k|{
  341|  2.52k|    return pthread_self();
  342|  2.52k|}

apr_time_ansi_put:
   68|  3.79k|{
   69|  3.79k|    *result = (apr_time_t)input * APR_USEC_PER_SEC;
  ------------------
  |  |   60|  3.79k|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  ------------------
  |  |  |  |   49|  3.79k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  ------------------
  |  |  |  |  |  |  390|  3.79k| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   70|  3.79k|    return APR_SUCCESS;
  ------------------
  |  |  225|  3.79k|#define APR_SUCCESS 0
  ------------------
   71|  3.79k|}

