From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: [PATCH] [long] typeset doesn't report tied parameters (and related issues)
Date: Tue, 9 Oct 2018 10:02:25 +0100 [thread overview]
Message-ID: <20181009090227eucas1p173feffa9928dc38719a0f2339a5d04e7~b5TzmA87n2378123781eucas1p1a@eucas1p1.samsung.com> (raw)
In-Reply-To: <1539017933.1412806.1534816128.38CEBA8F@webmail.messagingengine.com>
On Mon, 2018-10-08 at 16:58 +0000, Daniel Shahaf wrote:
> Peter Stephenson wrote on Mon, 08 Oct 2018 17:43 +0100:
> So the lex.c error may be an independent issue. The link to the typeset
> change is probably the failure address, 0x3A, which is the hex value of
> the ASCII colon character, which is the joinchar of $MANPATH.
That's interesting and points to a problem along the lines I suggested
--- confusion between special and non-special tied variables. MANPATH
as a special tied variable uses colonarrsetfn() / colonarrgetfn() to set
and retrieve values, which uses a colon implicitly, not from the
parameter structure. Non-special tied arrays have a tieddata structure
in the data.
I didn't get any reaction from the following, however.
pws
diff --git a/Src/params.c b/Src/params.c
index 089a958..b1420f7 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -4058,6 +4058,8 @@ char *
colonarrgetfn(Param pm)
{
char ***dptr = (char ***)pm->u.data;
+ DPUTS(!(pm->node.flags & PM_SPECIAL),
+ "Wrong get fn for npn-special tied array");
return *dptr ? zjoin(*dptr, ':', 1) : "";
}
@@ -4066,6 +4068,8 @@ void
colonarrsetfn(Param pm, char *x)
{
char ***dptr = (char ***)pm->u.data;
+ DPUTS(!(pm->node.flags & PM_SPECIAL),
+ "Wrong set fn for npn-special tied array");
/*
* We have to make sure this is never NULL, since that
* can cause problems.
@@ -4085,6 +4089,7 @@ char *
tiedarrgetfn(Param pm)
{
struct tieddata *dptr = (struct tieddata *)pm->u.data;
+ DPUTS(pm->node.flags & PM_SPECIAL, "Wrong get fn for special tied
array");
return *dptr->arrptr ? zjoin(*dptr->arrptr, STOUC(dptr->joinchar), 1) :
"";
}
@@ -4093,6 +4098,7 @@ void
tiedarrsetfn(Param pm, char *x)
{
struct tieddata *dptr = (struct tieddata *)pm->u.data;
+ DPUTS(pm->node.flags & PM_SPECIAL, "Wrong set fn for special tied
array");
if (*dptr->arrptr)
freearray(*dptr->arrptr);
next prev parent reply other threads:[~2018-10-09 9:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-24 21:05 [PATCH] typeset -p doesn't report -U (unique) attribute Stephane Chazelas
2018-09-25 16:41 ` Daniel Shahaf
2018-10-07 13:35 ` [PATCH] [long] typeset doesn't report tied parameters (and related issues) Stephane Chazelas
2018-10-08 9:05 ` Peter Stephenson
[not found] ` <CACeGjnUhNqca7jLAR0KKSxobzDd+xXdAe4BeUeRpxu2CTp_zkA@mail.gmail.com>
2018-10-08 14:10 ` Peter Stephenson
2018-10-08 14:28 ` Daniel Shahaf
2018-10-08 15:24 ` Peter Stephenson
2018-10-08 15:49 ` Daniel Shahaf
2018-10-08 15:57 ` Bart Schaefer
2018-10-08 16:06 ` Daniel Shahaf
2018-10-08 16:52 ` Bart Schaefer
2018-10-08 16:58 ` Peter Stephenson
2018-10-08 16:02 ` Daniel Shahaf
2018-10-08 16:19 ` Peter Stephenson
2018-10-08 16:43 ` Peter Stephenson
2018-10-08 16:58 ` Daniel Shahaf
2018-10-08 17:14 ` Bart Schaefer
2018-10-08 19:39 ` Stephane Chazelas
2018-10-09 9:02 ` Peter Stephenson [this message]
[not found] ` <1539075745.1499.2.camel@samsung.com>
2018-10-09 9:44 ` Peter Stephenson
2018-10-09 16:52 ` Bart Schaefer
2018-10-09 23:40 ` Vin Shelton
2018-10-08 15:54 ` Bart Schaefer
2018-10-08 16:40 ` Bart Schaefer
2018-10-09 10:59 ` local read-only variables (Was:[PATCH] [long] typeset doesn't report tied parameters (and related issues)) Stephane Chazelas
2018-10-11 9:45 ` [PATCH] [long] typeset doesn't report tied parameters (and related issues) Oliver Kiddle
2018-10-11 12:46 ` Peter Stephenson
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='20181009090227eucas1p173feffa9928dc38719a0f2339a5d04e7~b5TzmA87n2378123781eucas1p1a@eucas1p1.samsung.com' \
--to=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).