Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Aug 2013 12:09:59 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255072 - in head: bin/sh tools/regression/bin/sh/builtins
Message-ID:  <201308301209.r7UC9xZ9003473@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Fri Aug 30 12:09:59 2013
New Revision: 255072
URL: http://svnweb.freebsd.org/changeset/base/255072

Log:
  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.

Added:
  head/tools/regression/bin/sh/builtins/type3.0   (contents, props changed)
Modified:
  head/bin/sh/exec.c

Modified: head/bin/sh/exec.c
==============================================================================
--- head/bin/sh/exec.c	Fri Aug 30 11:42:57 2013	(r255071)
+++ head/bin/sh/exec.c	Fri Aug 30 12:09:59 2013	(r255072)
@@ -762,5 +762,7 @@ typecmd_impl(int argc, char **argv, int 
 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));
 }

Added: head/tools/regression/bin/sh/builtins/type3.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/type3.0	Fri Aug 30 12:09:59 2013	(r255072)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+[ "$(type type)" = "$(type -- type)" ]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308301209.r7UC9xZ9003473>