From mboxrd@z Thu Jan 1 00:00:00 1970 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes From: "Bart Schaefer" Message-Id: <990206225455.ZM2870@candle.brasslantern.com> Date: Sat, 6 Feb 1999 22:54:55 -0800 In-Reply-To: <19990207002352.A1656@dman.com> Comments: In reply to Clint Adams "Re: coredump on options parsing" (Feb 7, 12:23am) References: <19990206235023.A596@dman.com> <990206211711.ZM294@candle.brasslantern.com> <19990207002352.A1656@dman.com> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Clint Adams , zsh-workers@math.gatech.edu Subject: PATCH: 3.1.5: Re: coredump on options parsing MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailing-List: 5305 On Feb 7, 12:23am, Clint Adams wrote: } Subject: Re: coredump on options parsing } } > Some instructions on how to reproduce this might help. } } Sure. This occurs when you do zsh -c or -o without following arguments, } or attempt to run zsh on a nonexistent file. Aha. The problem is that ZLE is in a module, and the module hasn't yet been initialized at that point. So the function pointer for trashzle() does not actually point anywhere yet. (This is only true when NOT using dynamic modules, which is probably why nobody noticed.) The following should fix it. Index: Src/init.c =================================================================== --- init.c 1999/02/05 17:53:25 1.13 +++ init.c 1999/02/07 06:45:48 @@ -890,6 +890,20 @@ mod.nam = NULL; } +/**/ +void +noop_function(void) +{ + /* do nothing */ +} + +/**/ +void +noop_function_int(int nothing) +{ + /* do nothing */ +} + /* ZLE entry point pointers. They are defined here because the initial * * values depend on whether ZLE is linked in or not -- if it is, we * * avoid wasting space with the fallback functions. No other source * @@ -898,7 +912,7 @@ #ifdef LINKED_XMOD_zle /**/ -ZleVoidFn trashzleptr; +ZleVoidFn trashzleptr = noop_function; /**/ ZleVoidFn gotwordptr; /**/ @@ -919,20 +933,6 @@ # else /* !UNLINKED_XMOD_zle */ ZleReadFn zlereadptr = fallback_zleread; # endif /* !UNLINKED_XMOD_zle */ - -/**/ -void -noop_function(void) -{ - /* do nothing */ -} - -/**/ -void -noop_function_int(int nothing) -{ - /* do nothing */ -} /**/ # ifdef UNLINKED_XMOD_zle -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com