if (slen <= 0) return slen;
p = strchr(start, '$');
- if (!p || (p[1] != '{')) return slen;
+ if (!p) return slen;
+
+ if (!((p[1] == '{') ||
+ ((p[1] == 'E') && (p[2] == 'N') && (p[3] == 'V') &&
+ (p[4] == '{')))) {
+ return slen;
+ }
/*
* cf_expand_variables() doesn't take a length. Oh well...
if (!cf_expand_variables(filename, &lineno, parent, buffer, sizeof(buffer), expanded, NULL)) {
*error = "Failed expanding configuration variable";
return -1;
- }
+ }
talloc_free(expanded);
/*
* @todo - make this configurable
*/
case '$':
- if (p[1] != '{') {
+ if (p[1] == '{') {
+ *out = p;
+ *type = T_BARE_WORD;
+
+ p += 2;
+
+ } else if ((p[1] == 'E') && (p[2] == 'N') && (p[3] == 'V') &&
+ (p[4] == '{')) {
+ *out = p;
+ *type = T_BARE_WORD;
+
+ p += 2;
+
+ } else {
return_P("Unexpected '$'");
}
- *out = p;
- *type = T_BARE_WORD;
-
- p += 2;
while (*p && (*p != '}')) {
if (isspace((int) *p)) {
return_P("Unexpected space in variable expansion");