From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9671 invoked from network); 4 Apr 2000 17:17:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Apr 2000 17:17:54 -0000 Received: (qmail 13243 invoked by alias); 4 Apr 2000 17:17:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10477 Received: (qmail 13207 invoked from network); 4 Apr 2000 17:17:21 -0000 Date: Tue, 4 Apr 2000 13:17:13 -0400 From: Clint Adams To: zsh-workers@sunsite.auc.dk Subject: PATCH: zfcd_match erratic on some awks Message-ID: <20000404131713.A25031@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.1.2i Seems that behavior for an index of 0 is undefined. While this works out fine for gawk and Solaris awk, mawk has different ideas of what to do. This should make everybody happy. Index: Functions/Zftp/zfcd_match =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/Zftp/zfcd_match,v retrieving revision 1.2 diff -u -r1.2 zfcd_match --- Functions/Zftp/zfcd_match 2000/04/01 20:49:47 1.2 +++ Functions/Zftp/zfcd_match 2000/04/04 17:15:17 @@ -26,7 +26,7 @@ # to list, but not a glob. Don't ask me why. # I hate having to rely on awk here. zftp ls -LF $dir >$tmpf - reply=($(awk '/\/$/ { print substr($1, 0, length($1)-1) }' $tmpf)) + reply=($(awk '/\/$/ { print substr($1, 1, length($1)-1) }' $tmpf)) rm -f $tmpf [[ -n $dir && $dir != */ ]] && dir="$dir/" if [[ -n $WIDGET ]]; then