Commit b3db1aa
committed
fix: skip whitespace-only lines in _concatenate_shell_commands to prevent stray semicolons
When the prereq block (ending with 'fi;') is combined with the ability command via
'dep_construct \n command', a whitespace-only line between them caused
_concatenate_shell_commands to append '; ' after it, producing commands like
'fi; ; ip neighbour show' (issue #3097 on mitre/caldera).
Filtering out whitespace-only lines before concatenation eliminates the stray separator.
A regression test is included.1 parent b909588 commit b3db1aa
2 files changed
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
| 193 | + | |
193 | 194 | | |
194 | | - | |
195 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
181 | 192 | | |
182 | 193 | | |
183 | 194 | | |
| |||
0 commit comments