zsh-workers
 help / color / mirror / code / Atom feed
* ../ in PATH and completion
@ 2002-09-29  5:49 Clint Adams
  2002-09-29  6:54 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2002-09-29  5:49 UTC (permalink / raw)
  To: zsh-workers

1% mkdir /tmp/testdir /tmp/otherdir
2% touch /tmp/testdir/foobin
3% chmod 755 !$
4% zsh

A/1% PATH=/tmp/testdir
A/2% fo<TAB>
(will offer foobin as a completion, and hash it)

or

B/1% PATH=/tmp/otherdir/../testdir
B/2% fo<TAB>
(will not offer foobin, and not hash it)


In contrast, bin_whence likes it just fine.

C/1% PATH=/tmp/otherdir/../testdir
C/2% which foobin
/tmp/otherdir/../testdir/foobin
C/3% hash -L
hash foobin=/tmp/otherdir/../testdir/foobin


Why the inconsistency?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ../ in PATH and completion
  2002-09-29  5:49 ../ in PATH and completion Clint Adams
@ 2002-09-29  6:54 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2002-09-29  6:54 UTC (permalink / raw)
  To: Clint Adams, zsh-workers

On Sep 29,  1:49am, Clint Adams wrote:
} Subject: ../ in PATH and completion
}
} A/1% PATH=/tmp/testdir
} A/2% fo<TAB>
} (will offer foobin as a completion, and hash it)
} 
} or
} 
} B/1% PATH=/tmp/otherdir/../testdir
} B/2% fo<TAB>
} (will not offer foobin, and not hash it)

This is caused by hashdirs() skipping directories for which isrelative()
returns true.  It's entirely possible that isrelative() should not return
true for /absolute/../rest; but as of this writing, it does.

} In contrast, bin_whence likes it just fine.

That's because bin_whence() calls findcmd(), which does a direct search
of the path without using hashdirs().  The completion system always uses
the hash tables, and is therefore at the mercy of the HASH_* setopts.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-29  6:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-29  5:49 ../ in PATH and completion Clint Adams
2002-09-29  6:54 ` Bart Schaefer

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).