From nobody Sat Mar 05 19:56:56 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AA88F19FF6FC; Sat, 5 Mar 2022 19:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K9wV10bJgz3t6j; Sat, 5 Mar 2022 19:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646510217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tevUNQX4Te6GhHlrnbFc/kA8xAwuLLWukALGSBBsAGc=; b=IW6FOEqJI7FcSCvVL71rnBlW08oCo23syFcjnjx2EvCt+pLl0K5KvcAvr4pMnUdl1tx8s2 lYyfprzf6o4xpPxslwsWUJFKdhlNZglLawaFiDSPBaaYoET8pN9PdNE1G4+4fAr1nP6wKJ hrmsgYk8Tieooze+UJe2QhgKrZ9iaoF1DCMbVoAlLINtsL138RpWxtVnuMaCjOgkqLNw6c RWflAFJtHHoXAQXiifCVC5lImHNHu/TOhReK9UM2Vo3nr6pGkr/mlfHtMa9rIYh33N23w0 nzE0xcdmKZZkrmerS4jSeWEaCfVvQnjmj3W6W25oTE/E1c6VcGzGRDcVoJ9lNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBCFD25DF4; Sat, 5 Mar 2022 19:56:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 225Juume018260; Sat, 5 Mar 2022 19:56:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 225JuuNp018259; Sat, 5 Mar 2022 19:56:56 GMT (envelope-from git) Date: Sat, 5 Mar 2022 19:56:56 GMT Message-Id: <202203051956.225JuuNp018259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: ed87197672b4 - stable/13 - uname: -v: strip final whitespace compatibly with uname(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed87197672b44f7f76b38e6450df2b4071c88a67 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646510217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tevUNQX4Te6GhHlrnbFc/kA8xAwuLLWukALGSBBsAGc=; b=g9I6h52WsuXpzYT49Rrzxt60UfseZyZGRZOe05wFd/OQFtg8JQh7/FulnSQnFagUqScits 148Afz8hO97gH21P8UGwxPbBcRiZIjJiO3XeZj6VfbnviMYK1cxgvdHaFQoSLpcO/1PuI8 UncyoTQrFAIYerO0IO4+JPOPK++L562DHS1qZwRxPTxtg0F7cskMgDFmewVP3ZDMyvteyX fAaAHsxdOVx/q5ks8VwJizZ+a/fl74hdKABOo5JYTr9v+v6kDcjYqTkD+AvTd2k2Kq140q 94qc3l5pY5YOJP9jQb0OMvSIpToTzUPYmO2wCWS5l3VHpCGPDJR8R6musFA37Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646510217; a=rsa-sha256; cv=none; b=CPpi8Bs4pZNkFBuSrQnGhHK5glnKhapBh0g1XYYMobnTKTIZt5P5k39GD49qtRoZyBHkB4 Hj2VHVIoyZ59Eq932oCOMUgwEkrfEoqj5Qi2eBcbghJPPBO/uVQN4xbBAbDAbh2j3UJ0v5 zkl04XDTpunTtn+mp+q8Gn6EgGEJ7XqY79a71c9TVHTbeU9eo2V1+80KTXLgPFV6kmeXQF 86ZGMGYsTr4vuEX3HYNchd+bZ6BAuyv070j12FJbjk9Chz9hMYi5EB2PPQB5NJDjDEpv1O jyI+sQqa8TK4EQpM/AEhPrdELib6WV/KZ2skHFnp+sd7ouup04L4t7EmCnVXVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ed87197672b44f7f76b38e6450df2b4071c88a67 commit ed87197672b44f7f76b38e6450df2b4071c88a67 Author: наб AuthorDate: 2022-02-18 13:34:40 +0000 Commit: Mateusz Guzik CommitDate: 2022-03-05 19:56:11 +0000 uname: -v: strip final whitespace compatibly with uname(3) This restores POSIX.1 conformance PR: 260938 (cherry picked from commit 7e05fa3b449007adaa6e588ebb3b8d76f30b355c) --- usr.bin/uname/uname.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c index e97b9c3cb744..109505e4b9da 100644 --- a/usr.bin/uname/uname.c +++ b/usr.bin/uname/uname.c @@ -256,8 +256,12 @@ NATIVE_SYSCTL2_GET(version, CTL_KERN, KERN_VERSION) { p = NATIVE_BUFFER; n = NATIVE_LENGTH; for (; n--; ++p) - if (*p == '\n' || *p == '\t') - *p = ' '; + if (*p == '\n' || *p == '\t') { + if (n > 1) + *p = ' '; + else + *p = '\0'; + } } NATIVE_SET; NATIVE_SYSCTL2_GET(platform, CTL_HW, HW_MACHINE) {