From: "anonymous4feedback@outlook.com" <anonymous4feedback@outlook.com>
To: "dash@vger.kernel.org" <dash@vger.kernel.org>
Subject: Bug in dash: Incorrect behaviour of $LINENO in function
Date: Sat, 14 Jan 2023 05:30:09 +0000 [thread overview]
Message-ID: <PS2PR03MB38309A4880282F1C60C3094092C39@PS2PR03MB3830.apcprd03.prod.outlook.com> (raw)
Dear sir or madam,
For the following script,
foo(){ echo $LINENO; }
foo
foo(){
echo $LINENO
}
foo
dash incorrectly prints 2 for the foo on the last line. It seems dash stores the line number of the parameter substitution and the line number of the function definition, and add them to get the result. But the latter is not updated with the function get redefined.
Thanks.
next reply other threads:[~2023-01-14 5:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-14 5:30 anonymous4feedback [this message]
2023-01-14 9:39 ` Bug in dash: Incorrect behaviour of $LINENO in function Marc Chantreux
2023-01-14 10:57 ` 回复: " anonymous4feedback
2023-01-14 11:10 ` Harald van Dijk
2023-01-14 13:52 ` Marc Chantreux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PS2PR03MB38309A4880282F1C60C3094092C39@PS2PR03MB3830.apcprd03.prod.outlook.com \
--to=anonymous4feedback@outlook.com \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).