From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: Bug in autocompletion in CVS
Date: Thu, 03 Jul 2003 12:24:24 +0100 [thread overview]
Message-ID: <478.1057231464@csr.com> (raw)
In-Reply-To: "Vincent Driessen"'s message of "Thu, 03 Jul 2003 10:43:52 +0200." <20030703084352.GB24884@turkish>
Vincent Driessen wrote:
> I discovered a small bug in the version in pkgsrc/zsh. In a directory that
> contains filenames with spaces, you cannot use the tabcompletion properly whe
> n
> issueing a CVS command, for example, with these commands:
>
> % /foo> ls
> CVS/ foo
> bar this is a file name with spaces
> % /foo> cvs upd th[TAB]
>
> The filename part of the command is only expanded until the "this".
Bang to rights... I think the following simplified version works,
although I don't really know why it was so complicated in the first
place, so please say if this has side effects.
I think there may be a similar problem when checking for modified files,
but as the test is currently
[[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/${slash}[^${slash}]#${slash}//}%/[^/]#/[^/]#}:#${(j:|:)~${${${${(f)"$(LC_ALL=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${realdir}*(D) 2>/dev/null)"}##*/}/ //}//(#m)[][*?()<|^~#\\]/\\$MATCH}}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]] &&
_wanted files expl 'modified file' _path_files -g "$pat"
I don't feel like investigating more closely at the moment. (Is that
the World's Longest Ever Shell Substitution?)
Index: Completion/Unix/Command/_cvs
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_cvs,v
retrieving revision 1.19
diff -u -r1.19 _cvs
--- Completion/Unix/Command/_cvs 8 May 2003 10:30:48 -0000 1.19
+++ Completion/Unix/Command/_cvs 3 Jul 2003 11:20:40 -0000
@@ -912,8 +912,8 @@
linedir="$match[1]"
realdir=${(e)~linedir}
[[ -f "$realdir"CVS/Entries ]] &&
- [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}}"} ]] &&
- _wanted files expl file _path_files -g "$pat"
+ pat=(${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}%%/*})
+ (( ${#pat} )) && _wanted files expl file _path_files -a pat
}
(( $+functions[_cvs_modified_entries] )) ||
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
next prev parent reply other threads:[~2003-07-03 11:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-03 8:43 Vincent Driessen
2003-07-03 11:24 ` Peter Stephenson [this message]
2003-07-15 3:54 ` Bart Schaefer
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=478.1057231464@csr.com \
--to=pws@csr.com \
--cc=zsh-workers@sunsite.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).