1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

whence -a: fix spurious 'undefined function' message

$ ksh -c 'whence -a printf'
	printf is a shell builtin
	printf is /usr/bin/printf
	printf is an undefined function

The third line should not appear.

src/cmd/ksh93/bltins/whence.c:
- Remove faulty extra check for undefined (= autoload) functions.
  This was already handled earlier, on lines 192-193.

src/cmd/ksh93/tests/builtins.sh:
- Add regression test.
- For previous 'whence -a' test, don't bother with shell function.

Fixes https://github.com/ksh93/ksh/issues/26
This commit is contained in:
Martijn Dekker 2020-07-20 16:49:17 +01:00
parent b2bdbef561
commit 01c25cb14b
2 changed files with 13 additions and 8 deletions

View file

@ -250,8 +250,6 @@ static int whence(Shell_t *shp,char **argv, register int flags)
const char *command_path = np->nvalue.pathcomp->name;
sfprintf(sfstdout,"%s %s %s/%s\n",name,sh_translate(is_talias),command_path,cp);
}
else if(!np || nv_isnull(np))
sfprintf(sfstdout,"%s%s\n",name,sh_translate(is_ufunction));
continue;
}
sfputr(sfstdout,sh_fmtq(name),' ');