commit: 1515b614f83bc30fe1ed63d6a76bf4ede0b5c2f8
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sun May 19 22:03:53 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 20 07:50:05 2024 +0000
URL:
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=1515b614
Have _print_args() produce octal sequences for DEL
With this change, octal sequences are rendered for all non-printable
characters in the US-ASCII character set.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
functions.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/functions.sh b/functions.sh
index 94d0f98..bbbd114 100644
--- a/functions.sh
+++ b/functions.sh
@@ -603,7 +603,6 @@ _is_visible()
# of the ${*@Q} expansion in bash. The output shall be POSIX sh compatible as
of
# Issue 8. This should probably be made to exist as a standalone awk script.
#
-#
_print_args() {
awk -v q=\' -f - -- "$@" <<-'EOF'
BEGIN {
@@ -611,7 +610,7 @@ _print_args() {
ARGC = 1
for (arg_idx = 1; arg_idx < argc; arg_idx++) {
arg = ARGV[arg_idx]
- if (arg !~ /[\001-\037]/) {
+ if (arg !~ /[\001-\037\177]/) {
gsub(q, q "\\" q q, arg)
word = q arg q
} else {
@@ -621,6 +620,7 @@ _print_args() {
char = sprintf("%c", i)
ord_by[char] = i
}
+ ord_by["\177"] = 127
}
word = "$'"
for (i = 1; i <= length(arg); i++) {