commit:     0a5ca0538c3354e4328dee5a4cd452f35eac87fa
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Tue Jan 27 10:13:21 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 27 10:16:18 2026 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=0a5ca053

Have quote_args() honour POSIXLY_CORRECT where not exported

In the case that the quote_args() function is called from a shell other
than bash, the POSIXLY_CORRECT variable is only honoured where exported,
which is contrary to the currently specified interface.

Address this issue by ensuring that the POSIXLY_CORRECT variable is
propagated to the environment of shquote.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/functions.sh b/functions.sh
index ec2de56..3cda0d9 100644
--- a/functions.sh
+++ b/functions.sh
@@ -483,7 +483,7 @@ quote_args()
        if [ ! "${POSIXLY_CORRECT}" ] && [ "${BASH_VERSINFO-0}" -ge 5 ]; then
                _quote_args_bash "$@"
        else
-               shquote "$@"
+               POSIXLY_CORRECT=${POSIXLY_CORRECT} shquote "$@"
        fi
 }
 

Reply via email to