mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-24 23:14:14 +00:00
Since at least 1999, whence -v on pdksh (and its successor mksh) reports the path where an autoloadable function may be found: $ mkdir ~/fun; FPATH=~/fun $ echo 'myfn() { echo hi; }' >~/fun/myfn $ whence -v myfn myfn is a undefined (autoload from /home/user/fun/myfn) function Whereas ksh93 only reports, rather uselessly: myfn is an undefined function As of this commit, whence -v/-a on ksh 93u+m does the same as pdksh, but with correct grammar: myfn is an undefined function (autoload from /home/user/fun/myfn) This may be a small violation of my own "no new features" policy for 93u+m, but I couldn't resist. This omission has been annoying me, and it's just embarrassing to lack a pdksh feature :) src/cmd/ksh93/include/path.h, src/cmd/ksh93/data/msg.c: - Add e_autoloadfrom[] = " (autoload from %s)" message. src/cmd/ksh93/bltins/whence.c: whence(): - Report the path (if any) when reporting an undefined function. This needs to be done in two places: 1. When a function has been explicitly marked undefined with 'autoload', we need to do a quick path_search() loop to find the path. (These undefined functions take precedence over regular commands, so are reported first.) 2. When a function is not explicitly autoloaded but merely available in $FPATH, that path search was already done, so all we need to do is report it. (These are reported last.) Note that the output remains as on 93u+ if no function definition file is found on $FPATH. This is also like pdksh/mksh. src/cmd/ksh93/data/builtins.c: - Bump 'whence' version date. The inline docs never detailed very exactly what 'whence -v' reports, so no need for further edits. src/cmd/ksh93/tests/path.sh: - Regress-test the new whence behaviour plus actual autoloading, including the command override behaviour of autoloaded functions. |
||
---|---|---|
.. | ||
alias.sh | ||
append.sh | ||
arith.sh | ||
arrays.sh | ||
arrays2.sh | ||
attributes.sh | ||
basic.sh | ||
bracket.sh | ||
builtins.sh | ||
case.sh | ||
comvar.sh | ||
comvario.sh | ||
coprocess.sh | ||
cubetype.sh | ||
enum.sh | ||
exit.sh | ||
expand.sh | ||
functions.sh | ||
glob.sh | ||
grep.sh | ||
heredoc.sh | ||
io.sh | ||
leaks.sh | ||
locale.sh | ||
math.sh | ||
nameref.sh | ||
namespace.sh | ||
options.sh | ||
path.sh | ||
pointtype.sh | ||
pty.sh | ||
quoting.sh | ||
quoting2.sh | ||
readcsv.sh | ||
recttype.sh | ||
restricted.sh | ||
return.sh | ||
select.sh | ||
shtests | ||
sigchld.sh | ||
signal.sh | ||
statics.sh | ||
subshell.sh | ||
substring.sh | ||
tilde.sh | ||
timetype.sh | ||
treemove.sh | ||
types.sh | ||
variables.sh | ||
vartree1.sh | ||
vartree2.sh |