Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

trap handling segfault



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