On 08/01/2023 12:07, Herbert Xu wrote:
On Thu, Jan 05, 2023 at 01:49:47PM +0100, наб wrote:
This ensures even something like
alias 'a|b|c=d'
is output by alias as
'a|b|c'='d'
instead of
a|b|c='d'
which is both "suitable for reinput to the shell" per POSIX
and doesn't execute the aliases as code.
---
src/alias.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Did either of you test this patch before submitting and pushing it?
Actually running current dash git, I'm seeing
$ src/dash -c 'alias foo=bar; alias foo'
'bar'='bar'
single_quote() is written so that it writes to stackblock() without
reserving the memory. The second single_quote() call is always going to
clobber the first.
Cheers,
Harald van Dijk