zsh-workers
 help / color / mirror / code / Atom feed
From: greg@itasoftware.com (Greg Klanderman)
To: zsh-workers@sunsite.auc.dk (Zsh list)
Subject: segfault in 3.1.6 in completion
Date: Wed, 23 Feb 2000 19:34:25 -0500 (EST)	[thread overview]
Message-ID: <14516.31889.777264.838702@phl.itasoftware.com> (raw)


Please copy me in any replies.

Start 3.1.6 with no init files and load the below attached completion
functions.  Now if you go into a directory containing CVS controlled
files and try

  % cvstest foobar/

(where foobar is some directory) and hit TAB you get a crash 

Program received signal SIGSEGV, Segmentation fault.

#0  0x809fc6d in makecomplistflags ()
#1  0x809d53b in makecomplistlist ()
#2  0x809d4bf in makecomplistor ()
#3  0x809d43a in makecomplistcc ()
#4  0x809d362 in makecomplistcmd ()
#5  0x809d1e1 in makecomplistglobal ()
#6  0x809bea3 in makecomplist ()
#7  0x809abb8 in docompletion ()
#8  0x80949f3 in docomplete ()
#9  0x809398e in expandorcomplete ()
#10 0x808d67c in execzlefunc ()
#11 0x808d3d6 in zleread ()
#12 0x8063e7d in inputline ()
#13 0x8063dc5 in ingetc ()
#14 0x805f6a9 in ihgetc ()
#15 0x80674e7 in gettok ()
#16 0x8066ffe in yylex ()
#17 0x8071d3c in parse_event ()
#18 0x8062601 in loop ()
#19 0x804a73a in main ()

Unfortunately I didn't build with debugging on and don't have time
right now.  Figured I'd send this first just in case it's already been
fixed..

If there is no directory (ie complete file in current directory), or
if you disable the "-y _cvscompletions", it works fine.

thanks,

Greg


# mostly stolen from the zsh distribution

compctl -/K _cvstargets -y _cvscompletions cvstest 

_cvsprefix () { 
  local nword args f
  read -nc nword; read -Ac args
  pref=$args[$nword]
  if [[ -d $pref:h && ! -d $pref ]]; then
    pref=$pref:h
  elif [[ $pref != */* ]]; then
    pref=
  fi
  [[ -n "$pref" && "$pref" != */ ]] && pref=$pref/
}

_cvsentries () { 
  setopt localoptions nullglob unset
  if [[ -f ${pref}CVS/Entries ]]; then
    reply=( "${pref}${^${(@)${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D*}#/}%%/*}[@]}" )
  fi
}

_cvscompletions () { 
  setopt localoptions noksharrays
  local c cc
  reply=( )
  for c in $@ ; do
    cc="${c##*/}"
    [[ -d "$c" ]] && cc="$cc/"
    reply=( $reply[@] $cc )
  done
}

_cvstargets () {
  setopt localoptions noksharrays
  local pref
  _cvsprefix
  _cvsentries
}


             reply	other threads:[~2000-02-24  0:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-24  0:34 Greg Klanderman [this message]
2000-02-24  9:36 Sven Wischnowsky
2000-02-24 16:37 ` Greg Klanderman

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=14516.31889.777264.838702@phl.itasoftware.com \
    --to=greg@itasoftware.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).