zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Clint Adams <clint@dman.com>, zsh-workers@math.gatech.edu
Subject: PATCH: 3.1.5: Re: coredump on options parsing
Date: Sat, 6 Feb 1999 22:54:55 -0800	[thread overview]
Message-ID: <990206225455.ZM2870@candle.brasslantern.com> (raw)
In-Reply-To: <19990207002352.A1656@dman.com>

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 <filename> 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


      reply	other threads:[~1999-02-07  6:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-07  4:50 Clint Adams
1999-02-07  5:17 ` Bart Schaefer
1999-02-07  5:23   ` Clint Adams
1999-02-07  6:54     ` Bart Schaefer [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=990206225455.ZM2870@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=clint@dman.com \
    --cc=zsh-workers@math.gatech.edu \
    /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).