From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8433 invoked by alias); 9 Dec 2014 17:30:57 -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: X-Seq: 33941 Received: (qmail 19678 invoked from network); 9 Dec 2014 17:30:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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 autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f126d000001e9a-8e-548731caaeb7 Date: Tue, 09 Dec 2014 17:30:47 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: free() error on simple input scripts Message-id: <20141209173047.3541fdc9@pwslap01u.europe.root.pri> In-reply-to: References: <20141206042732.GA28745@ti.fritz.box> <141206150753.ZM2978@torch.brasslantern.com> <141206223657.ZM28506@torch.brasslantern.com> 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=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKLMWRmVeSWpSXmKPExsVy+t/xa7qnDNtDDCb+kLQ42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGe8vLWAq2MtZsfrDZuYGxhPsXYycHBICJhK/Jn1lhLDFJC7c W8/WxcjFISSwlFFi++v3jBDOEiaJbd8vQGW2MUp8XXCPCaSFRUBV4sjPK8wgNpuAocTUTbPB RokIiEucXXueBcQWBopfmvIPzOYVsJeYt3geUA0HB6eAq8SGs7ogYSGB04wSM1Zqg9j8AvoS V/9+YoK4yF5i5pUzjBCtghI/Jt8DG8MsoCWxeVsTK4QtL7F5zVtmiDnqEjfu7mafwCg0C0nL LCQts5C0LGBkXsUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kRErRfdjAuPmZ1iFGAg1GJh9dc sTVEiDWxrLgy9xCjBAezkgjvWpb2ECHelMTKqtSi/Pii0pzU4kOMTBycUg2Mng/DDP5axZsa C6o0MVnwnGrYdz/lgSTHZ8XrCTftujYFBTjq+TdJVPxVZbuzq8FO4cGdtTL5z3S5Ptit/tT7 747Az/fLb/3kXnkqlo0/+5TKDd34lNTjbbo5xae+ejrPfPZnhq9WisGK2am27xbbM73wZQi+ IqCga/slbt4KZaak8j/cgpeUWIozEg21mIuKEwGh6SQcOAIAAA== On Wed, 10 Dec 2014 00:45:42 +0900 Jun T. wrote: > 2014/12/07 15:36, Bart Schaefer wrote: > > > source =(<<<$'d\\\0') > > The input backslash-null is metafiled by shingetline() to > backslash-meta-space (since 0 xor 32 = 32 = ' '), but it seems > the lexer does not treat the meta after backslash specially and > interprets the space as a word separator; this results in a > word ending with meta. > > What is the "correct" behavior for the input backslash-null? > The following may be a possibility but I'm not sure. > (The ifdef DEBUG part is copied from line 1059 in the same file) I *think* your patch is correct. Certainly, it is valid to get metafied input at the lexer. See for example the end of zleread() which calls zlegetline() which calls zlelineasstring (typically --- unless we already have a metafied line) which metafies the line that's about to be returned. I'm a bit surprised the lexer doesn't have more cases like this, or a more general way of dealing with metafied characters, but handling a backslash the way you suggest looks perfectly OK. However, wait and see what Bart says, too. pws