Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2022 07:31:24 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 46441] sh(1): Does not support PS1, PS2, PS4 parameter expansion
Message-ID:  <bug-46441-227-j8nEzV92Ah@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-46441-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-46441-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D46441

--- Comment #11 from Nathaniel Barragan <contact@nathanielbarragan.xyz> ---
I took a look at the code super fast (not planning on any changes yet), and=
 it
seems that command substitution was not added on $PS1/PS2 because the parser
relies on PS1 and PS2 not doing command substitution on those variables. Fr=
om
what it seems, the parser would need to be redone to become re-entrant. Thi=
s is
because it has some state stored in static global variables, which are clea=
red
each parse.
A possible solution, and one that frankly doesn't sound fun would be to fig=
ure
out which variables are the ones that hold state local to parsing, and which
are really required to be static and global, and move these state-keeping
variables to a structure, then pass that structure to each parsing function.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-46441-227-j8nEzV92Ah>