[PATCH] eval: Prevent recursive PS4 expansion

2020-05-26 Thread Herbert Xu
Yaroslav Halchenko wrote: > > I like to (ab)use PS4 and set -x for tracing execution of scripts. > Reporting time and PID is very useful in this context. > > I am not 100% certain if bash's behavior (of actually running the command > embedded within PS4 string, probably eval'ing it) is actually

[PATCH] parser: Get rid of PEOA

2020-05-26 Thread Herbert Xu
PEOA is a special character used to mark an alias as being finished so that we don't enter an infinite loop with nested aliases. It complicates the parser because we have to ensure that it is skipped where necessary and not copied to the resulting token text. This patch removes it and instead del

parser: Fix double-backslash nl in old-style command sub

2020-05-26 Thread Herbert Xu
Ron Yorston wrote: > > Alternatively I see that BusyBox ash did this: > >case '\\': > - pc = pgetc(); > - if (pc == '\n') { > - nlprompt(); > - /* > -* If eating a newline, avoid putting > -