| 831 | } |
| 832 | |
| 833 | AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line) |
| 834 | { |
| 835 | const char *str = *line, *strend; |
| 836 | char *res; |
| 837 | char quote; |
| 838 | |
| 839 | while (apr_isspace(*str)) |
| 840 | ++str; |
| 841 | |
| 842 | if (!*str) { |
| 843 | *line = str; |
| 844 | return ""; |
| 845 | } |
| 846 | |
| 847 | if ((quote = *str) == '"' || quote == '\'') { |
| 848 | strend = str + 1; |
| 849 | while (*strend && *strend != quote) { |
| 850 | if (*strend == '\\' && strend[1] && |
| 851 | (strend[1] == quote || strend[1] == '\\')) { |
| 852 | strend += 2; |
| 853 | } |
| 854 | else { |
| 855 | ++strend; |
| 856 | } |
| 857 | } |
| 858 | res = substring_conf(p, str + 1, strend - str - 1, quote); |
| 859 | |
| 860 | if (*strend == quote) |
| 861 | ++strend; |
| 862 | } |
| 863 | else { |
| 864 | strend = str; |
| 865 | while (*strend && !apr_isspace(*strend)) |
| 866 | ++strend; |
| 867 | |
| 868 | res = substring_conf(p, str, strend - str, 0); |
| 869 | } |
| 870 | |
| 871 | while (apr_isspace(*strend)) |
| 872 | ++strend; |
| 873 | *line = strend; |
| 874 | return res; |
| 875 | } |
| 876 | |
| 877 | AP_DECLARE(char *) ap_getword_conf2_nc(apr_pool_t *p, char **line) |
| 878 | { |
no test coverage detected