From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id DAA00922 for ; Tue, 16 Jul 1996 03:13:41 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA17424; Mon, 15 Jul 1996 13:01:29 -0400 (EDT) Resent-Date: Mon, 15 Jul 1996 13:01:29 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960715100208.ZM21843@candle.brasslantern.com> Date: Mon, 15 Jul 1996 10:02:04 -0700 In-Reply-To: "Bart Schaefer" "Re: Another patch to compctl-examples CVS compctl, and a bug?" (Jul 15, 12:03am) References: <199607150102.DAA03226@turan.elte.hu> <960715000308.ZM3130@candle.brasslantern.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.702 02jul96) To: Zoltan Hidvegi , zsh-workers@math.gatech.edu Subject: Re: Another patch to compctl-examples CVS compctl, and a bug? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"31Rsg3.0.BG4.ebdwn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1657 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 15, 12:03am, Bart Schaefer wrote: } Subject: Re: Another patch to compctl-examples CVS compctl, and a bug? } } Here's a patch, to be applied on top of my last patch, that incorporates } some of the changes suggested by the discussion. It avoids using $(<...) } construct on nonexistent files because of the stray newline that appears. Seems Zoltan and I had similar thoughts on this ... but you don't need the 2>/dev/null redirection if you're testing ahead of time for the existence of the CVS/Entries file. Here's my same patch except against 3.0-pre3. *** Misc/compctl-examples.0 Mon Jul 15 00:07:16 1996 --- Misc/compctl-examples Mon Jul 15 09:57:31 1996 *************** *** 439,449 **** pref= fi [[ -n "$pref" && "$pref" != */ ]] && pref=$pref/ ! if [[ -f "${pref}CVS/Entries" ]] then ! reply=( "${pref}${^${${(f@)$(cat ${pref}CVS/Entries 2> /dev/null)}#/}%%/*}" ! ${pref}*/**/CVS(:h) ) else ! reply=( ${pref}*/**/CVS(:h) ) fi } #------------------------------------------------------------------------------ --- 439,450 ---- pref= fi [[ -n "$pref" && "$pref" != */ ]] && pref=$pref/ ! if [[ -f ${pref}CVS/Entries ]] ! then ! reply=( "${pref}${^${${(f@)$(<${pref}CVS/Entries)}#/}%%/*}" ! ${pref}*/**/CVS(:h) ) else ! reply=( ${pref}*/**/CVS(:h) ) fi } #------------------------------------------------------------------------------ -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"