Perform quote removal before command substitution

This commit is contained in:
Sergey Poznyakoff 2014-10-23 23:17:31 +03:00
parent 74ec801338
commit b591f0aee6

View file

@ -1668,6 +1668,14 @@ wordsplit_process_list (struct wordsplit *wsp, size_t start)
}
}
if (wsnode_quoteremoval (wsp))
return wsp->ws_errno;
if (wsp->ws_flags & WRDSF_SHOWDBG)
{
wsp->ws_debug ("After quote removal:");
wordsplit_dump_nodes (wsp);
}
/* Expand commands */
if (!(wsp->ws_flags & WRDSF_NOCMD))
{
@ -1692,26 +1700,15 @@ wordsplit_process_list (struct wordsplit *wsp, size_t start)
}
}
do
if (wsnode_coalesce (wsp))
return wsp->ws_errno;
if (wsp->ws_flags & WRDSF_SHOWDBG)
{
if (wsnode_quoteremoval (wsp))
break;
if (wsp->ws_flags & WRDSF_SHOWDBG)
{
wsp->ws_debug ("After quote removal:");
wordsplit_dump_nodes (wsp);
}
if (wsnode_coalesce (wsp))
break;
if (wsp->ws_flags & WRDSF_SHOWDBG)
{
wsp->ws_debug ("Coalesced list:");
wordsplit_dump_nodes (wsp);
}
wsp->ws_debug ("Coalesced list:");
wordsplit_dump_nodes (wsp);
}
while (0);
return wsp->ws_errno;
}