Dear Maintainer,
Consider the following invocation:
/bin/printf "%q" $'\001'\'$'\001'
(i.e. 1st=dollar+letter q, 2nd=byte 1+apostrophe+byte 1)
What do you expect the output to be? I'd expect something like
$'\001'\'$'\001'
or, in the, rather verbose, printf format,
''$'\001'\'''$'\001'
Okay, now what does the invocation output?
'\001'\'''$'\001'
Uh-oh! And what fill feeding that into an Almquist shell give?
$ echo -n '\001'\'''$'\001' | hexdump -C
00000000 5c 30 30 31 27 01 |\001'.|
00000006
Sheesh!
As far as I can tell, a sequence of any string that needs escaping,
followed by an apostrophe, followed by another string that needs
escaping will trigger this, and the example above is the minimal case.
наб