diff options
author | jilles <jilles@FreeBSD.org> | 2013-08-30 12:09:59 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-08-30 12:09:59 +0000 |
commit | 8b7d6031e6e1457ba0eb1e4ac04ad72adcb7c2ee (patch) | |
tree | b23efef6513a6a367069a13eb80f2c1f48c0dec0 /bin | |
parent | 0030cdac07df412f040b7616431b47c1265e0e69 (diff) | |
download | FreeBSD-src-8b7d6031e6e1457ba0eb1e4ac04ad72adcb7c2ee.zip FreeBSD-src-8b7d6031e6e1457ba0eb1e4ac04ad72adcb7c2ee.tar.gz |
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.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/exec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/sh/exec.c b/bin/sh/exec.c index 5f78de9..9f8e029 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)); } |