return_P("Unterminated expansion");
case '/':
+ if (!require_regex) goto bare_word;
+
quote = *(p++);
*type = T_OP_REG_EQ;
goto skip_string;
goto skip_word;
default:
+ bare_word:
*out = p;
quote = '\0';
if (p[1] == '{') {
p += 2;
depth++;
+ continue;
} else if ((p[1] == 'E') &&
(p[2] == 'N') &&
(p[4] == '{')) {
p += 5;
depth++;
+ continue;
} else {
/*
}
}
+ if (*p == '%') {
+ if (p[1] == '{') {
+ p += 2;
+ depth++;
+ continue;
+ }
+
+ p++;
+ continue;
+ }
+
/*
* If we're inside of a ${...} expansion,
* then allow everything until the
/*
* Allowed in attribute names, and/or
- * host names and IP addresses.
+ * host names and IP addresses, and IPv6 addresses.
+ */
+ if ((*p == '.') || (*p == '/') || (*p == '_') || (*p == '*') ||
+ (*p == ']')) {
+ p++;
+ continue;
+ }
+
+ /*
+ * [...] is an IPv6 address.
*/
- if ((*p == '.') || (*p == '/') || (*p == '_')) {
+ if ((p == start) && (*p == '[')) {
p++;
continue;
}
*/
if ((*p == '#') || (*p == '*') || (*p == 'n')) {
p++;
+
} else {
/*
* Allow numbers as array indexes