# include <unistd.h>
#endif
-#if defined (HAVE_STRING_H)
-# include <string.h>
-#else /* !HAVE_STRING_H */
-# include <strings.h>
-#endif /* !HAVE_STRING_H */
+#include "bashansi.h"
#if defined (SHELL)
# include "shell.h"
#include "general.h"
#define brace_whitespace(c) (!(c) || (c) == ' ' || (c) == '\t' || (c) == '\n')
+#if defined (SHELL)
+extern char *extract_command_subst ();
+#endif
+
/* Basic idea:
Segregate the text into 3 sections: preamble (stuff before an open brace),
int satisfy;
{
register int i, c, quoted, level, pass_next;
+#if defined (SHELL)
+ int si;
+ char *t;
+#endif
level = quoted = pass_next = 0;
continue;
}
+#if defined (SHELL)
+ /* Pass new-style command substitutions through unchanged. */
+ if (c == '$' && text[i+1] == '(') /* ) */
+ {
+ si = i + 2;
+ t = extract_command_subst (text, &si);
+ i = si;
+ free (t);
+ continue;
+ }
+#endif
+
if (c == satisfy && level == 0 && quoted == 0)
{
/* We ignore an open brace surrounded by whitespace, and also