bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quotearg: shell escape issue with single quote


From: Pádraig Brady
Subject: Re: quotearg: shell escape issue with single quote
Date: Wed, 3 Apr 2024 21:56:30 +0100
User-agent: Mozilla Thunderbird

On 31/03/2024 22:02, Bruno Haible wrote:
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).

The attached should fix this issue.

cheers,
Pádraig

Attachment: 0001-quotearg-fix-shell-escape-quoting-with-single-quotes.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]