}
memset(&globdata, 0, sizeof(globdata));
+//TODO: can use GLOB_BRACE | GLOB_TILDE here:
gr = glob(pattern, 0, NULL, &globdata);
debug_printf_glob("glob('%s'):%d\n", pattern, gr);
if (gr == GLOB_NOSPACE)
goto skip;
}
#endif
+
+#if 0 /* Prevented by caller */
if (command->argv /* word [word]{... */
|| dest->length /* word{... */
|| dest->o_quoted /* ""{... */
"syntax error, groups and arglists don't mix\n");
return 1;
}
+#endif
#if ENABLE_HUSH_FUNCTIONS
skip:
return pi;
}
nommu_addchr(&ctx.as_string, ch);
+
+ next = '\0';
+ if (ch != '\n')
+ next = i_peek(input);
+
+ is_special = "{}<>;&|()#'" /* special outside of "str" */
+ "\\$\"" IF_HUSH_TICK("`"); /* always special */
+ /* Are { and } special here? */
+ if (ctx.command->argv /* word [word]{... */
+ || dest.length /* word{... */
+ || dest.o_quoted /* ""{... */
+ || (next != ';' && next != ')' && !strchr(G.ifs, next)) /* {word */
+ ) {
+ /* They are not special, skip "{}" */
+ is_special += 2;
+ }
+ is_special = strchr(is_special, ch);
is_ifs = strchr(G.ifs, ch);
- is_special = strchr("<>;&|(){}#'" /* special outside of "str" */
- "\\$\"" IF_HUSH_TICK("`") /* always special */
- , ch);
if (!is_special && !is_ifs) { /* ordinary char */
ordinary_char:
if (is_ifs)
continue;
- next = '\0';
- if (ch != '\n') {
- next = i_peek(input);
- }
-
/* Catch <, > before deciding whether this word is
* an assignment. a=1 2>z b=2: b=2 is still assignment */
switch (ch) {