From owner-freebsd-bugs@freebsd.org Sun Mar 1 01:38:14 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48F77248A3E for ; Sun, 1 Mar 2020 01:38:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 48VQs16tWKz4Z2t for ; Sun, 1 Mar 2020 01:38:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id EB221248A3D; Sun, 1 Mar 2020 01:38:13 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA769248A3C for ; Sun, 1 Mar 2020 01:38:13 +0000 (UTC) (envelope-from bugzilla-noreply@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48VQs15DCGz4Z2k for ; Sun, 1 Mar 2020 01:38:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DDD623DBE for ; Sun, 1 Mar 2020 01:38:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 0211cDe5007210 for ; Sun, 1 Mar 2020 01:38:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 0211cD2M007209 for bugs@FreeBSD.org; Sun, 1 Mar 2020 01:38:13 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 235589] sh(1): LINENO is unset in shell arithmetic Date: Sun, 01 Mar 2020 01:38:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.0-STABLE X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: me@pacopascal.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: jilles@FreeBSD.org X-Bugzilla-Flags: mfc-stable12? mfc-stable11? X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2020 01:38:14 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235589 Paco Pascal changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212048|0 |1 is obsolete| | --- Comment #5 from Paco Pascal --- Created attachment 212062 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D212062&action= =3Dedit Perfect LINENO behavior? This patch is the same as the last one I posted, except it asserts that LIN= ENO can't be 0 and LINENO in functions were off by 1. In the previous patch I posted, echo ` echo $LINENO` would output 0. There might be a better method of ensuring this than what I= did in parser.c. As far as I can see, this makes LINENO behave in every way it should. The following, echo $LINENO $((LINENO)) $(($LINENO)) PS4=3D'$LINENO+ ' echo `echo $LINENO` eval 'echo $LINENO $((LINENO)) $(($LINENO))' all perform in what I think is expected ways. --=20 You are receiving this mail because: You are on the CC list for the bug.=