From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: [BUG] Strange auto-load behaviour when function name contains hyphen
Date: Fri, 15 Dec 2017 09:09:03 +0000 [thread overview]
Message-ID: <20171215090903.32d8db36@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <0110C9C8-53D2-49B4-B0F2-1F3F6A7E6EAC@dana.is>
On Thu, 14 Dec 2017 11:21:21 -0600
dana <dana@dana.is> wrote:
> On 14 Dec 2017, at 04:28, Peter Stephenson <p.stephenson@samsung.com> wrote:
> >+ /*
> >+ * See if name of function requested (name) is same as
> >+ * name of function in word code. name may still have "-"
> >+ * tokenised.
> >+ */
> >+ ptr1 = name;
> >+ ptr2 = ecrawstr(prog, pc + 1, NULL);
> >+ while (*ptr1 && *ptr2) {
> >+ if (*ptr1 != *ptr2 && *ptr1 != Dash && *ptr2 != '-')
>
> I think there's another error here. name isn't the one that might be tokenised
> (or it's not in my case anyway) — it's the other one.
That suggests another bug since I don't think function names in the word
code ought to be tokenised, but quite possibly that hasn't been an issue
up to now. I haven't gone looking for that --- I've just handled both
cases (and added a test for the obvious case).
> Understanding a bit more about the token thing, i went and tested some of the
> others defined in zsh.h. The same problem occurs if you have a function name
> containing almost any of them.
Dash is a bit of a special case, since in normal zsh syntax it's
actually not a pattern character. Things like * and ? will cause
immediate expansion, so any function name using them always has to be
quoted. There's not a lot of point in supporting ths, though, as you
say, it's not explicitly excluded at the moment.
Quotes are stripped from the word on the command line before the
comparision. I think that's all that sanity really requires.
pws
prev parent reply other threads:[~2017-12-15 9:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171214064805epcas2p196a185a6c3c5e66640833d8dfa15d593@epcas2p1.samsung.com>
2017-12-14 6:46 ` dana
2017-12-14 10:01 ` Peter Stephenson
2017-12-14 10:28 ` Peter Stephenson
2017-12-14 17:21 ` dana
2017-12-15 2:33 ` dana
2017-12-15 9:09 ` Peter Stephenson [this message]
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=20171215090903.32d8db36@pwslap01u.europe.root.pri \
--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).