Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
trap handling segfault
- X-seq: zsh-workers 11837
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: trap handling segfault
- Date: Fri, 9 Jun 2000 10:02:41 -0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
The following snippet will cause 3.1.9 to die with a SEGV (in gdb it dumps
at the blank line just before the declaration of periodic(), without gdb
it dumps when periodic is actually called).
I haven't looked at this in depth, but it's dying in endtrapscope()
when it tries to dereference st->list->funcdef (when st->list happens to
be NULL). Reversing 11736 smoothes things out.
----8<----
function TRAPEXIT ()
{
/bin/rm -f /tmp/jobs$HOST$$
}
function set-title ()
{
if [[ "$1" = "-k" ]]
then
shift
KEPT_TITLE="$* "
else
TITLE=$*
fi
[[ "$TERM" = "xterm" ]] && print -n -D -P "\033]2;${KEPT_TITLE}${TITLE}\007"
}
function accept-line {
local cmd=${BUFFER%%" "*}
local oldtitle=$TITLE
[[ -n "$cmd" ]] && set-title $TITLE "->" $cmd
TITLE=$oldtitle
zle .accept-line
}
zle -N accept-line
function periodic () { }
----8<----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author