1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-24 15:04:13 +00:00
cde/src/cmd/ksh93/include
Johnothan King 8a34fc40e6
whence -f: ignore functions (#137)
According to 'whence --man', 'whence -f' should ignore functions:
  -f              Do not check for functions.

Right now this is only accomplished partially. As of commit
a329c22d 'whence -f' avoids any output when encountering a
function (in ksh93u+ 'whence -f' has incorrect output). The
return value is still wrong though:

$ foo() { true; }
$ whence -f foo; echo $?
0

This commit fixes the return value and makes 'type -f' error out
when given a function (like in Bash).

src/cmd/ksh93/bltins/whence.c:
- If -f was passed, set 'cp' to NULL since functions should be
  ignored (as documented).
- Simplify return value by avoiding bitwise logic.

src/cmd/ksh93/tests/builtins.sh:
- Add regression tests for 'whence -f' and 'type -f'.

Co-authored-by: Martijn Dekker <martijn@inlv.org>
2020-09-26 19:26:18 +01:00
..
argnod.h 4 typo fixes: be use => be used 2020-07-05 07:48:01 +02:00
builtins.h Remove SHOPT_BASH; keep &> redir operator, '-o posix' option 2020-09-01 06:19:19 +01:00
defs.h Fix hang in comsubs (rhbz#1062296) (re: 970069a6) 2020-09-24 06:07:12 +02:00
edit.h include/edit.h: cleanup: rm unused Edit_t struct members 2020-09-16 06:38:53 +02:00
fault.h Remove legacy code for older libast versions 2020-09-04 02:31:39 +02:00
fcin.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
history.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
io.h Fix command substitutions in here-docs (rhbz#994241, rhbz#1036802) 2020-09-21 23:02:08 +02:00
jobs.h Fix crash in backtick comsubs with job control on (rhbz#825520) 2020-09-23 01:56:09 +02:00
lexstates.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
name.h Multiple 'whence' and path search fixes 2020-09-20 07:56:09 +02:00
national.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
nval.h nval.h: remove dtksh additions & old compat redefs (re: e2d1b593) 2020-08-17 23:11:51 +01:00
path.h whence -v/-a: report path to autoloadable functions 2020-09-25 17:45:40 +02:00
regress.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shell.h Fix BUG_LOOPRET2 and related return/exit misbehaviour 2020-09-09 20:02:20 +02:00
shlex.h Remove SHOPT_BASH; keep &> redir operator, '-o posix' option 2020-09-01 06:19:19 +01:00
shnodes.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shtable.h Reinstate 'r' and 'history' as preset aliases for interactive ksh 2020-09-11 21:35:45 +02:00
streval.h Remove legacy code for older libast versions 2020-09-04 02:31:39 +02:00
terminal.h Fixes for implicit declaration warnings 2020-06-14 09:55:08 -04:00
test.h restore 'test --man --' oddness (re: fa6a180f) 2020-08-31 23:43:22 +01:00
timeout.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
ulimit.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
variables.h Add ${.sh.pid} as an alternative to $BASHPID (#109) 2020-08-07 02:53:25 +01:00
version.h whence -f: ignore functions (#137) 2020-09-26 19:26:18 +01:00