commit:     99c365cfd43ac4eee86538d70de017b5baa7cc2e
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  1 09:04:55 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Jun  1 09:04:55 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=99c365cf

EAPI=9/edo: fix indets and add comment

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 data/lib/pkgcore/ebd/eapi/9/global.bash | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/data/lib/pkgcore/ebd/eapi/9/global.bash 
b/data/lib/pkgcore/ebd/eapi/9/global.bash
index 3e067a0c..6578c833 100644
--- a/data/lib/pkgcore/ebd/eapi/9/global.bash
+++ b/data/lib/pkgcore/ebd/eapi/9/global.bash
@@ -19,15 +19,17 @@ pipestatus() {
 }
 
 edo() {
-       # copied from edo.eclass
+       # list of special characters taken from sh_contains_shell_metas
+       # in shquote.c (bash-5.2)
        local a out regex='[] '\''"\|&;()<>!{}*[?^$`]|^[#~]|[=:]~'
 
        [[ $# -ge 1 ]] || die "edo: at least one argument needed"
 
        for a; do
-        [[ ${a} =~ ${regex} || ! ${a} =~ ^[[:print:]]+$ ]] && a=${a@Q}
-        out+=" ${a}"
-    done
+               # quote if (and only if) necessary
+               [[ ${a} =~ ${regex} || ! ${a} =~ ^[[:print:]]+$ ]] && a=${a@Q}
+               out+=" ${a}"
+       done
 
        einfon
        printf '%s\n' "${out:1}" >&2

Reply via email to