Problem
_loop_parts finds a loop's do and done by command position alone and never reads the quote mask. A quoted ";" before a done word therefore reads as a separator, and the loop is closed there, before its real done.
Reproduce (constructed)
Allowed on develop, and bash prints ; done, sleeps, and repeats forever:
while true; do echo ";" done; sleep 1; done
Done looks like
_loop_parts takes the quote mask where it is known and ignores a quoted separator when it looks for do and done. The command above is denied, and a self-test row pins it.
Found by the local strict review of the #2080 fix (handoff #2137). It predates that fix.
Problem
_loop_partsfinds a loop'sdoanddoneby command position alone and never reads the quote mask. A quoted";"before adoneword therefore reads as a separator, and the loop is closed there, before its realdone.Reproduce (constructed)
Allowed on develop, and bash prints
; done, sleeps, and repeats forever:Done looks like
_loop_partstakes the quote mask where it is known and ignores a quoted separator when it looks fordoanddone. The command above is denied, and a self-test row pins it.Found by the local strict review of the #2080 fix (handoff #2137). It predates that fix.