MCPcopy Create free account
hub / github.com/apache/httpd / ap_getword_conf2

Function ap_getword_conf2

server/util.c:882–929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880}
881
882AP_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
931AP_DECLARE(int) ap_cfg_closefile(ap_configfile_t *cfp)
932{

Callers 2

set_hc_conditionFunction · 0.85
ap_getword_conf2_ncFunction · 0.85

Calls 2

ap_getword_confFunction · 0.85
substring_confFunction · 0.85

Tested by

no test coverage detected