]> Savannah Git Hosting - gnulib.git/commit
quotearg: fix shell-escape quoting with single quotes
authorPádraig Brady <P@draigBrady.com>
Wed, 3 Apr 2024 14:46:47 +0000 (15:46 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 3 Apr 2024 22:18:18 +0000 (23:18 +0100)
commit07b31a9465e74910f4d5d9c64a98af54035350c9
treea52d4c4c699cfd092d5fcbf6d967522369a4f09f
parent519a00edc928ac0a32405878c2ab9af309427797
quotearg: fix shell-escape quoting with single quotes

With shell-escape quoting, we misquoted strings
where the first and last characters required escaping,
while the string also contained single quotes.

* lib/quotearg.c (quotearg_buffer_restyled): Ensure that
pending_shell_escape_end is reset to the initial state
when reprocessing input due to single quotes.
* tests/test-quotearg-simple.c: Add a minimal test case.
* tests/test-quotearg.c: Likewise.
* tests/test-quotearg.h: Likewise.
Reported by Grisha Levit
ChangeLog
lib/quotearg.c
tests/test-quotearg-simple.c
tests/test-quotearg.c
tests/test-quotearg.h