Pádraig Brady wrote:
If a string starts with a sequence that requires $'' quoting followed
by a \' and then another charactrer requiring $'' quoting, the '$' at
the start of the quoted string ends up missing:
$ env printf '%q\n' $'\1\'\2'
'\001'\'''$'\002'
Indeed that is a bug.
I'll be able to have a look at this tomorrow.
The '$' at the beginning is only missing in specific cases:
$ ./printf '%q\n' $'\1\'\2'
'\001'\'''$'\002'
$ ./printf '%q\n' $'a\1\'\2'
'''a'$'\001'\'''$'\002'
$ ./printf '%q\n' $'\1\'\2x'
''$'\001'\'''$'\002''x'
Also, let me apply some documentation improvement to the .h file (attached).