mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
sh: Recognize "--" as end of options in type builtin.
This implementation makes minimal changes: command names starting with "-" (other than "--") can still be queried normally.
This commit is contained in:
parent
8d99b9cebd
commit
65519ccb4d
2 changed files with 5 additions and 0 deletions
|
|
@ -762,5 +762,7 @@ typecmd_impl(int argc, char **argv, int cmd, const char *path)
|
|||
int
|
||||
typecmd(int argc, char **argv)
|
||||
{
|
||||
if (argc > 2 && strcmp(argv[1], "--") == 0)
|
||||
argc--, argv++;
|
||||
return typecmd_impl(argc, argv, TYPECMD_TYPE, bltinlookup("PATH", 1));
|
||||
}
|
||||
|
|
|
|||
3
tools/regression/bin/sh/builtins/type3.0
Normal file
3
tools/regression/bin/sh/builtins/type3.0
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# $FreeBSD$
|
||||
|
||||
[ "$(type type)" = "$(type -- type)" ]
|
||||
Loading…
Reference in a new issue