From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27123 invoked from network); 27 Jul 2004 22:19:40 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Jul 2004 22:19:40 -0000 Received: (qmail 60804 invoked from network); 27 Jul 2004 22:19:20 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Jul 2004 22:19:20 -0000 Received: (qmail 9366 invoked by alias); 27 Jul 2004 22:17:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20202 Received: (qmail 23989 invoked from network); 27 Jul 2004 21:50:59 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 27 Jul 2004 21:50:59 -0000 Received: (qmail 86807 invoked from network); 27 Jul 2004 21:19:53 -0000 Received: from proxy.vc-graz.ac.at (193.171.121.30) by a.mx.sunsite.dk with SMTP; 27 Jul 2004 21:19:52 -0000 Received: from localhost (b-55.vc-graz.ac.at [193.171.241.55]) by proxy.vc-graz.ac.at (8.12.11/8.12.11) with ESMTP id i6QMUJr6022877 for ; Tue, 27 Jul 2004 00:30:19 +0200 (MEST) Date: Tue, 27 Jul 2004 00:30:20 +0200 From: Michael Prokop To: zsh-workers@sunsite.dk Subject: Util/helpfiles - problem with provided example Message-ID: <2004-07-27T00-04-58@netz.michael-prokop.at> Reply-To: Michael Prokop Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-URL: http://www.michael-prokop.at/ X-Operating-System: Debian GNU/Linux - 2.6.2 on a i686 X-Registered-Linux-User: 224337 X-Crypto: GnuPG/1.2.3 http://www.gnupg.org X-GPG-Key-ID: 0x37E272E8 X-GPG-Key: http://www.michael-prokop.at/gpg X-GPG-Fingerprint: 04AE E62C 9502 CD34 A7DA 857B D8DF 53FB 37E2 72E8 User-Agent: Mutt/1.5.6i X-Virus-Scanned: clamd / ClamAV version 0.75, clamav-milter version 0.75 on proxy.vc-graz.ac.at X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-1.5 required=6.0 tests=BAYES_01 autolearn=no version=2.63 X-Spam-Hits: -1.5 Hello, I just found a problem when using the example function provided in zsh/Util/helpfiles. I'm refering to current zsh-cvs-sources. An example: $ which man # this is the function 'run-help' which I'm using in my setup man () { typeset zhelp=~/.zsh/zsh_help # or wherever [[ $1 = . ]] && 1=dot [[ $1 = : ]] && 1=colon if [[ $1 = compctl ]] then man zshcompctl elif [[ -f $zhelp/$1 ]] then ${=PAGER:-more} $zhelp/$1 else command man $* # notice this line fi } $ man zsh # now I'm trying to read the manual - works -> Reformatting zsh(1), please wait... $ run-help() { # now I do copy/paste from Util/helpfiles -> typeset zhelp=~/.zsh/zsh_help # or wherever [[ $1 = . ]] && 1=dot [[ $1 = : ]] && 1=colon if [[ $1 = compctl ]]; then man zshcompctl elif [[ -f $zhelp/$1 ]]; then ${=PAGER:-more} $zhelp/$1 else man $1 # this is the original fi } $ man zsh Segmentation fault $ The important difference in the two functions: 'man $1' vs. 'command man $*'. The '$*' is important for covering cmdlines like 'man 3 printf'. AFAICS the segfault happens because of the recursive 'man'-function. Maybe this could be changed in Util/helpfiles because it might be a trap ;-). regards, (-: Michael -- www.michael-prokop.at ~ ~ ".signature" [New] 1L, 22C [w]