From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8987 invoked by alias); 8 Feb 2010 22:45:36 -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: 27693 Received: (qmail 26141 invoked from network); 8 Feb 2010 22:45:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Date: Tue, 9 Feb 2010 09:45:25 +1100 From: Geoff Wing To: Zsh Hackers Subject: Re: termcap/terminfo includes Message-ID: <20100208224525.GA24871@primenet.com.au> References: <4B6EA9B1.4030001@NetBSD.org> <20100208105012.6417d49d@news01> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100208105012.6417d49d@news01> Organization: PrimeNet Computer Consultancy User-Agent: Mutt/1.5.20 (2009-06-14) On Monday 2010-02-08 10:50 +0000, Peter Stephenson output: :Please could you send a minimal change to fix your problem? A generic :solution is obviously better (though fraught for the reasons above) but :we'll certainly make do with a system-specific test. For the longer term, changing the name of the variable "underscore" works. Regards, Geoff --- exec.c.org 2009-12-18 04:31:16.000000000 +1100 +++ exec.c 2010-02-05 13:27:22.000000000 +1100 @@ -2191,17 +2191,17 @@ int l = strlen(str) + 1, nl = (l + 31) & ~31; if (nl > underscorelen || (underscorelen - nl) > 64) { - zfree(underscore, underscorelen); - underscore = (char *) zalloc(underscorelen = nl); + zfree(zunderscore, underscorelen); + zunderscore = (char *) zalloc(underscorelen = nl); } - strcpy(underscore, str); + strcpy(zunderscore, str); underscoreused = l; } else { if (underscorelen > 128) { - zfree(underscore, underscorelen); - underscore = (char *) zalloc(underscorelen = 32); + zfree(zunderscore, underscorelen); + zunderscore = (char *) zalloc(underscorelen = 32); } - *underscore = '\0'; + *zunderscore = '\0'; underscoreused = 1; } } @@ -4506,7 +4506,7 @@ ou = zalloc(ouu = underscoreused); if (ou) - memcpy(ou, underscore, underscoreused); + memcpy(ou, zunderscore, underscoreused); while (wrap) { wrap->module->wrapper++; @@ -4750,7 +4750,7 @@ es->traplocallevel = traplocallevel; es->noerrs = noerrs; es->subsh_close = subsh_close; - es->underscore = ztrdup(underscore); + es->underscore = ztrdup(zunderscore); es->next = exstack; exstack = es; noerrs = cmdoutpid = 0; --- init.c.org 2010-02-05 04:34:51.000000000 +1100 +++ init.c 2010-02-05 13:26:29.000000000 +1100 @@ -42,7 +42,7 @@ /* buffer for $_ and its length */ /**/ -char *underscore; +char *zunderscore; /**/ int underscorelen, underscoreused; @@ -818,9 +818,9 @@ ifs = ztrdup(DEFAULT_IFS); wordchars = ztrdup(DEFAULT_WORDCHARS); postedit = ztrdup(""); - underscore = (char *) zalloc(underscorelen = 32); + zunderscore = (char *) zalloc(underscorelen = 32); underscoreused = 1; - *underscore = '\0'; + *zunderscore = '\0'; zoptarg = ztrdup(""); zoptind = 1; --- params.c.org 2010-01-14 04:30:16.000000000 +1100 +++ params.c 2010-02-05 13:27:39.000000000 +1100 @@ -3974,7 +3974,7 @@ char * underscoregetfn(UNUSED(Param pm)) { - char *u = dupstring(underscore); + char *u = dupstring(zunderscore); untokenize(u); return u; --- utils.c.org 2009-12-18 04:31:20.000000000 +1100 +++ utils.c 2010-02-05 13:27:47.000000000 +1100 @@ -1356,7 +1356,7 @@ usav = zalloc(underscoreused); if (usav) - memcpy(usav, underscore, underscoreused); + memcpy(usav, zunderscore, underscoreused); setunderscore(*s);