From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29634 invoked by alias); 6 May 2011 15:06:26 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29168 Received: (qmail 24096 invoked from network); 6 May 2011 15:06:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110506080555.ZM21390@torch.brasslantern.com> Date: Fri, 06 May 2011 08:05:55 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Patch (?) for _path_files MIME-version: 1.0 Content-type: text/plain; charset=us-ascii I believe this has to do with the thread "Re: Another _path_files bug?" from the first couple of weeks of February 2011. --- ../zsh-forge/current/Completion/Unix/Type/_path_files 2011-02-13 10:44 :16 -0800 +++ ./Completion/Unix/Type/_path_files 2011-02-13 10:51:33 -0800 @@ -751,10 +751,11 @@ [[ "$tsuf" != /* ]] && mid="$testpath" if [[ -z "$_comp_correct" && -n "$compstate[pattern_match]" && "$tmp2" = (|*[^\\])[][*?#~^\|\<\>]* ]]; then - cpre="${cpre}${tmp1[1]%%/*}/" + cpre="${cpre}${tmp1[1]%%/*}" else - cpre="${cpre}${tpre}/" + cpre="${cpre}${tpre}" fi + [[ "$tsuf" = /* ]] && cpre+=/ tpre="${tsuf#*/}" tsuf= else I backed out most of my scratch work from that thread when PWS posted workers/28750, but kept this bit -- for reasons that sadly I now no longer remember. It avoids appending a slash to the common prefix (if I recall correctly what cpre means, which I may not) unless there was a leading slash on the tested suffix (again IIRC tsuf). I suspect this was meant to prevent double slash appearing in some completions. Any opinions on whether this is correct/useful?