- while(i < 0 || variables[i].name) {
- if(i < 0 && !strncasecmp(sub[i + 4], text, strlen(text)))
- return xstrdup(sub[i + 4]);
- if(i >= 0) {
- char *dot = strchr(text, '.');
- if(dot) {
- if((variables[i].type & VAR_HOST) && !strncasecmp(variables[i].name, dot + 1, strlen(dot + 1))) {
- char *match;
- xasprintf(&match, "%.*s.%s", dot - text, text, variables[i].name);
- return match;
- }
- } else {
- if(!strncasecmp(variables[i].name, text, strlen(text)))
- return xstrdup(variables[i].name);
+ while(variables[i].name) {
+ char *dot = strchr(text, '.');
+ if(dot) {
+ if((variables[i].type & VAR_HOST) && !strncasecmp(variables[i].name, dot + 1, strlen(dot + 1))) {
+ char *match;
+ xasprintf(&match, "%.*s.%s", dot - text, text, variables[i].name);
+ return match;