From nobody Fri Jan 13 21:30:32 2023 X-Original-To: dev-commits-src-main@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 4Ntvj56H77z2qllG; Fri, 13 Jan 2023 21:30:33 +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 4Ntvj51300z4CRH; Fri, 13 Jan 2023 21:30:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673645433; 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=cP4PrQJwGCWJ3TXwnmcct3TLvMqFgjIDpFvjWMASEl4=; b=xU9n//Kg23JAVZMtmpKYhSZWpqRgIFck71Ik12xFP8uhi4xVWkvzGw18tzZN/tB0yKsfLS 4WyHnqR0a6H1TRAFDT6ZdgD28fFpXHV1FPdE0RS51srb3kdjtpkkR8hV8G7ZNgrFdvKcdD 1Ax2jP8aGH1Wt+pMUVL1+oDNxVQUEgU0LvWj+yP2dyEbVqrs843jpwwlynRsq523bNWTm8 YNFIS/V7b56Br0og6WpZ3XUEVi0mrakTcdyCOkexo8TlU3guZwkeWTJGZr/Tp9GIhWcHHm AakmdKBz9Ciexo0qDDxAgSNPdao9ovHbx406avSmLnR9tCnAjw0BkYZOrUdvzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673645433; 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=cP4PrQJwGCWJ3TXwnmcct3TLvMqFgjIDpFvjWMASEl4=; b=RafmIN8L1t+icD2kxz39HHAP+bI7qoA3UrDv1KnUKLE/yM8l53s14huDj3jMGTtBUmkeq9 iChpKeBNHzaLHIT8op8aapRRzRHaQcOjQDfBTH8/8tDvC7Fmmcs+XSC384YxbbTcqEYpy4 69wuMoPAIuPznl8pRYyX7sDKV020JFFSBUl/AmCcduq2Q4pKnodYcWbuGSfKF3B6uXgqGG 71+nArNCD3gC4Nhek5CjPmkviwDtBFs+x8HLIvokd6luNPoSHhna3tYBSAd86sgBo9rT4d mxIZGPo4ge803SYYJ08iSyjcF+lXENwgNRAPtFELfqIKAyE/JlppIGdWqjWwTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673645433; a=rsa-sha256; cv=none; b=I3U3Pb4gLvPXnYj4wHDSD0MOefAEBSjcpLbcoY9O42DxFYNDYs5crFkJVR9LoZESoSZEhL WSl/4hoMB4vRDOWZhKjWc3GjctUbnZfLSjkXS0ig+PQ9lpCgZ0RARQMEJznVPnn+hkDxRf soSEuIbjZK/g/55w9OTfJeri9QrRWZTMEuT4B5PzkjBWLIBlAcNLaJaK3gZGxVoDBrZqIO p5z0T2+u4bJwyOdeOZR4PmjDN0cgpqbuRch5lcOu3YIOk/ejpCadYjazfrMHgTVgjeFfPU rQEJPYILwFMh/eu69D70D6en37rAL6OS1pLQKVZHx2/YIaTrKoH6ZR5CauqvXQ== 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 4Ntvj475HdzNF7; Fri, 13 Jan 2023 21:30:32 +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 30DLUWYd052144; Fri, 13 Jan 2023 21:30:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30DLUWMB052143; Fri, 13 Jan 2023 21:30:32 GMT (envelope-from git) Date: Fri, 13 Jan 2023 21:30:32 GMT Message-Id: <202301132130.30DLUWMB052143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 92e978439f0c - main - cal: don't print terminal control characters unless stdout is a TTY List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92e978439f0c3139775ad96d412959f5a74b17b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=92e978439f0c3139775ad96d412959f5a74b17b6 commit 92e978439f0c3139775ad96d412959f5a74b17b6 Author: Alan Somers AuthorDate: 2023-01-13 20:19:03 +0000 Commit: Alan Somers CommitDate: 2023-01-13 21:30:00 +0000 cal: don't print terminal control characters unless stdout is a TTY A similar change was made in svn r223931, but it was incomplete, working only when the utility was invoked as "ncal". Fix the same issue when invoking as "cal". PR: 268936 Reported by: Ray Bellis MFC after: 2 weeks Sponsored by: Axcient Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D38045 --- usr.bin/ncal/ncal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c index 8f94264efcd2..5a6c33ce759d 100644 --- a/usr.bin/ncal/ncal.c +++ b/usr.bin/ncal/ncal.c @@ -930,7 +930,8 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) dt.d = j - jan1 + 1; else sdateb(j, &dt); - if (j == highlightdate && !flag_nohighlight) + if (j == highlightdate && !flag_nohighlight + && isatty(STDOUT_FILENO)) highlight(mlines->lines[i] + k, ds + dt.d * dw, dw, &l); else