diff --git a/bin/sh/exec.c b/bin/sh/exec.c index 5f78de91a32..9f8e029933e 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -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)); } diff --git a/tools/regression/bin/sh/builtins/type3.0 b/tools/regression/bin/sh/builtins/type3.0 new file mode 100644 index 00000000000..87cccdd812c --- /dev/null +++ b/tools/regression/bin/sh/builtins/type3.0 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +[ "$(type type)" = "$(type -- type)" ]