diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-10-23 23:17:31 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-17 15:25:24 +0200 |
commit | 49b4b7e2e45bd22992df25ab999cb8c3ed73930f (patch) | |
tree | 70ef0ad34f8f63da296f8bf4562ad11919f33864 | |
parent | 82f402caf19c334f3975fd5a74c2a7fd3f21603d (diff) | |
download | grecs-49b4b7e2e45bd22992df25ab999cb8c3ed73930f.tar.gz grecs-49b4b7e2e45bd22992df25ab999cb8c3ed73930f.tar.bz2 |
wordsplit: perform quote removal before command substitution
-rw-r--r-- | src/wordsplit.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/wordsplit.c b/src/wordsplit.c index b2382c8..f0170e1 100644 --- a/src/wordsplit.c +++ b/src/wordsplit.c @@ -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; } |