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

Function set_regex_default_options

server/core.c:2996–3046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2994}
2995
2996static const char *set_regex_default_options(cmd_parms *cmd,
2997 void *dummy,
2998 const char *arg)
2999{
3000 const command_rec *thiscmd = cmd->cmd;
3001 int cflags, cflag;
3002
3003 const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
3004 if (err != NULL) {
3005 return err;
3006 }
3007
3008 cflags = ap_regcomp_get_default_cflags();
3009 while (*arg) {
3010 const char *name = ap_getword_conf(cmd->pool, &arg);
3011 int how = 0;
3012
3013 if (strcasecmp(name, "none") == 0) {
3014 cflags = 0;
3015 continue;
3016 }
3017
3018 if (*name == '+') {
3019 name++;
3020 how = +1;
3021 }
3022 else if (*name == '-') {
3023 name++;
3024 how = -1;
3025 }
3026
3027 cflag = ap_regcomp_default_cflag_by_name(name);
3028 if (!cflag) {
3029 return apr_psprintf(cmd->pool, "%s: option '%s' unknown",
3030 thiscmd->name, name);
3031 }
3032
3033 if (how > 0) {
3034 cflags |= cflag;
3035 }
3036 else if (how < 0) {
3037 cflags &= ~cflag;
3038 }
3039 else {
3040 cflags = cflag;
3041 }
3042 }
3043 ap_regcomp_set_default_cflags(cflags);
3044
3045 return NULL;
3046}
3047
3048static const char *set_server_alias(cmd_parms *cmd, void *dummy,
3049 const char *arg)

Callers

nothing calls this directly

Calls 5

ap_check_cmd_contextFunction · 0.85
ap_getword_confFunction · 0.85

Tested by

no test coverage detected