From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18084 invoked by alias); 15 Dec 2017 09:09:28 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42130 Received: (qmail 25625 invoked by uid 1010); 15 Dec 2017 09:09:28 -0000 X-Qmail-Scanner-Diagnostics: from mailout2.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.12):SA:0(-6.9/5.0):. Processed in 12.992654 secs); 15 Dec 2017 09:09:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20171215090908euoutp02201ba17fccf3a6dcaa9e364be84358c6~AbKkn_UDg2609626096euoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1513328948; bh=DU+MWpBcosvuVlbN0eX11nq60icEeAIVZuL6zvJNAMg=; h=Date:From:To:Subject:In-reply-to:References:From; b=n9arQUDtRyPpcA5n6F9hCAl3GSzxThOby5vKc3hSvF5uqMXC4dstmTpszP1hZlXbs uLlLPuCvLX6mkXKh9S7rJ+1/TJ6BwRClV+7/hhVLVMZ70xRYxQRsb4o4ymnwlmksme Udm4pNhMyKAvleZNBXaNZy07CPGykWtuSQgemYfQ= X-AuditID: cbfec7f4-f790c6d0000075d3-ef-5a3391331c99 Date: Fri, 15 Dec 2017 09:09:03 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [BUG] Strange auto-load behaviour when function name contains hyphen Message-id: <20171215090903.32d8db36@pwslap01u.europe.root.pri> In-reply-to: <0110C9C8-53D2-49B4-B0F2-1F3F6A7E6EAC@dana.is> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLIsWRmVeSWpSXmKPExsWy7djP87rGE42jDFatULU42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGbPfPGQv2MFTsXLuNtYGxmOcXYycHBICJhJbm7pYIGwxiQv3 1rN1MXJxCAksZZT4eu0zM4TTyySx5PtHRpiOHa272EBsIYFljBJTfkdBFE1jkth7ZisThHOG UWLe1RWsEM5ZRokJ5yYCzeLgYBFQldjxxAakm03AUGLqptlgU0UExCXOrj0PdoewQLDEmp5V YHFeAXuJY693sIO0cgpYS7R91QEJ8wvoS1z9+4kJ4iB7iZlXzkCVC0r8mHwPbAyzgKbE1t3r 2SFsbYkn7y6AnSMhMIdNouHrK6ifXSTePfjIDGELS7w6voUdwpaR6Ow4CLWgn1HiSbcvRPMM RonTZ3awQSSsJfpuX2SE2MAnMWnbdLAfJQR4JTrahCBKPCT2r2mAmukocX7LNEZImKxmkpgw 9yn7BEaFWUgOn4Xk8FlIDl/AyLyKUSS1tDg3PbXYRK84Mbe4NC9dLzk/dxMjMBGc/nf8yw7G xcesDjEKcDAq8fBatBlFCbEmlhVX5h5ilOBgVhLhvedmHCXEm5JYWZValB9fVJqTWnyIUZqD RUmc1zaqLVJIID2xJDU7NbUgtQgmy8TBKdXAmHPjfUdZqLpME8PpvH3yn9V6dF3TnDRUrlw+ 9Lfy79Nk6Qla65ZlVju37egvr9MQ8n/pzadUKJiU/OmI+Yac3s/q2qxsz75IHTuT7nbyjn8x 7wcG1biGGTKyr1hOHc92U6loEuVQ7JvHvqQzbsbRGp5K2QuWU2e8+vnqz2fdlgcVHmc3PDBR YinOSDTUYi4qTgQAsK21eQADAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHLMWRmVeSWpSXmKPExsVy+t/xa7pGE42jDP71W1kcbH7I5MDoserg B6YAxigum5TUnMyy1CJ9uwSujNlvHrIX7OCpWDl3G2sD4zHOLkZODgkBE4kdrbvYIGwxiQv3 1gPZXBxCAksYJY7ves8C4cxgkvjYfYgZpEpI4ByjxLs1ShCJs4wSk35sYe9i5OBgEVCV2PHE BqSGTcBQYuqm2YwgtoiAuMTZtedZQGxhgWCJNT2rwOK8AvYSx17vAGvlFLCWaPuqAzFyLZPE rH/3wWr4BfQlrv79xARxnb3EzCtnoHoFJX5Mvgc2k1lAXWLSvEXMELa2xJN3F1gh7lSXuHF3 N/sERuFZSFpmIWmZhaRlASPzKkaR1NLi3PTcYkO94sTc4tK8dL3k/NxNjMBQ3nbs5+YdjJc2 Bh9iFOBgVOLhtWgzihJiTSwrrsw9xCjBwawkwnvPzThKiDclsbIqtSg/vqg0J7X4EKM0B4uS OG/vntWRQgLpiSWp2ampBalFMFkmDk6pBkaWx9GBleL7amu5OAWmLGqz4g/ZxD9/SX5UtoL7 dAOPC5KREa6z1i3fJaA+pWqTh3JV61QbX778+r+XlmcLrF14UEhj01K7hPt6/3bZcZl7F9zw CV73mzEqdHq/SYb3m3YG9fQpN/rtRX9n336Xd3UX45W/bdPvatu7SHh+fJXC/ubuh+gfbEos xRmJhlrMRcWJANEFtrphAgAA X-CMS-MailID: 20171215090906eucas1p18537d2f3a98d69045bdb4fb01fbb2c65 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171214064805epcas2p196a185a6c3c5e66640833d8dfa15d593 X-RootMTR: 20171214064805epcas2p196a185a6c3c5e66640833d8dfa15d593 References: <990A7EB2-C4BA-4E3D-99B3-7DA40846CBD1@dana.is> <20171214100142.27516153@pwslap01u.europe.root.pri> <20171214102827.78f302fd@pwslap01u.europe.root.pri> <0110C9C8-53D2-49B4-B0F2-1F3F6A7E6EAC@dana.is> On Thu, 14 Dec 2017 11:21:21 -0600 dana wrote: > On 14 Dec 2017, at 04:28, Peter Stephenson wro= te: > >+ /* > >+ * See if name of function requested (name) is same as > >+ * name of function in word code. name may still have "-" > >+ * tokenised. > >+ */ > >+ ptr1 =3D name; > >+ ptr2 =3D ecrawstr(prog, pc + 1, NULL); > >+ while (*ptr1 && *ptr2) { > >+ if (*ptr1 !=3D *ptr2 && *ptr1 !=3D Dash && *ptr2 !=3D '-') >=20 > I think there's another error here. name isn't the one that might be toke= nised > (or it's not in my case anyway) =E2=80=94 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 n= ame > 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