Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Mar 2020 01:38:11 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 235589] sh(1): LINENO is unset in shell arithmetic
Message-ID:  <bug-235589-227-Rbgmr6WzOg@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-235589-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-235589-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235589

Paco Pascal <me@pacopascal.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #212048|0                           |1
        is obsolete|                            |

--- Comment #5 from Paco Pascal <me@pacopascal.com> ---
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-235589-227-Rbgmr6WzOg>