1d932a
diff --git a/braces.c b/braces.c
1d932a
index 2febed7..61c1ab1 100644
1d932a
--- a/braces.c
1d932a
+++ b/braces.c
1d932a
@@ -529,6 +529,11 @@ brace_gobbler (text, tlen, indx, satisfy)
1d932a
	{
1d932a
	  if (c == quoted)
1d932a
	    quoted = 0;
1d932a
+#if defined (SHELL)
1d932a
+         /* The shell allows quoted command substitutions */
1d932a
+         if (quoted == '"' && c == '$' && text[i+1] == '(')    /*)*/
1d932a
+           goto comsub;
1d932a
+#endif
1d932a
	  ADVANCE_CHAR (text, tlen, i);
1d932a
	  continue;
1d932a
	}
1d932a
@@ -551,6 +556,7 @@ brace_gobbler (text, tlen, indx, satisfy)
1d932a
       /* Pass new-style command and process substitutions through unchanged. */
1d932a
       if ((c == '$' || c == '<' || c == '>') && text[i+1] == '(')			/* ) */
1d932a
	{
1d932a
+comsub:
1d932a
	  si = i + 2;
1d932a
	  t = extract_command_subst (text, &si, 0);
1d932a
	  i = si;