| 880 | } |
| 881 | |
| 882 | AP_DECLARE(char *) ap_getword_conf2(apr_pool_t *p, const char **line) |
| 883 | { |
| 884 | const char *str = *line, *strend; |
| 885 | char *res; |
| 886 | char quote; |
| 887 | int count = 1; |
| 888 | |
| 889 | while (apr_isspace(*str)) |
| 890 | ++str; |
| 891 | |
| 892 | if (!*str) { |
| 893 | *line = str; |
| 894 | return ""; |
| 895 | } |
| 896 | |
| 897 | if ((quote = *str) == '"' || quote == '\'') |
| 898 | return ap_getword_conf(p, line); |
| 899 | |
| 900 | if (quote == '{') { |
| 901 | strend = str + 1; |
| 902 | while (*strend) { |
| 903 | if (*strend == '}' && !--count) |
| 904 | break; |
| 905 | if (*strend == '{') |
| 906 | ++count; |
| 907 | if (*strend == '\\' && strend[1] && strend[1] == '\\') { |
| 908 | ++strend; |
| 909 | } |
| 910 | ++strend; |
| 911 | } |
| 912 | res = substring_conf(p, str + 1, strend - str - 1, 0); |
| 913 | |
| 914 | if (*strend == '}') |
| 915 | ++strend; |
| 916 | } |
| 917 | else { |
| 918 | strend = str; |
| 919 | while (*strend && !apr_isspace(*strend)) |
| 920 | ++strend; |
| 921 | |
| 922 | res = substring_conf(p, str, strend - str, 0); |
| 923 | } |
| 924 | |
| 925 | while (apr_isspace(*strend)) |
| 926 | ++strend; |
| 927 | *line = strend; |
| 928 | return res; |
| 929 | } |
| 930 | |
| 931 | AP_DECLARE(int) ap_cfg_closefile(ap_configfile_t *cfp) |
| 932 | { |
no test coverage detected