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

Re: Another patch to compctl-examples CVS compctl, and a bug?



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"




Messages sorted by: Reverse Date, Date, Thread, Author