From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id ABEEA1581D3 for ; Wed, 22 May 2024 01:12:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 93886E2A31; Wed, 22 May 2024 01:12:26 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7C642E2A31 for ; Wed, 22 May 2024 01:12:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AA49933BEBB for ; Wed, 22 May 2024 01:12:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 03F0D1AFD for ; Wed, 22 May 2024 01:12:24 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1716191407.e1b0fb2a8eb93814ff1d895964ad03d5166175e3.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions.sh X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: e1b0fb2a8eb93814ff1d895964ad03d5166175e3 X-VCS-Branch: master Date: Wed, 22 May 2024 01:12:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 082cc590-746e-446b-85de-ba0158560a8e X-Archives-Hash: e7162d8ead908c5b7c4cc79f6e2f4c30 commit: e1b0fb2a8eb93814ff1d895964ad03d5166175e3 Author: Kerin Millar plushkava net> AuthorDate: Mon May 20 05:55:55 2024 +0000 Commit: Sam James gentoo org> CommitDate: Mon May 20 07:50:07 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=e1b0fb2a Correct an awk else clause in _print_args() The routine was working correctly anyway, but through fortune. Stick to using curly braces to avoid any mishaps further down the line. Signed-off-by: Kerin Millar plushkava.net> functions.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/functions.sh b/functions.sh index bbbd114..100bd30 100644 --- a/functions.sh +++ b/functions.sh @@ -625,21 +625,25 @@ _print_args() { word = "$'" for (i = 1; i <= length(arg); i++) { char = substr(arg, i, 1) - if (char == "\\") + if (char == "\\") { word = word "\\\\" - else if (char == q) + } else if (char == q) { word = word "\\'" - else + } else { ord = ord_by[char] - if (ord != "") + if (ord != "") { word = word "\\" sprintf("%03o", ord) - else + } else { word = word char + } + } } word = word q } line = line word - if (arg_idx < argc - 1) line = line " " + if (arg_idx < argc - 1) { + line = line " " + } } print line }