From owner-svn-src-all@FreeBSD.ORG Sun Aug 25 11:42:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C5FBB310; Sun, 25 Aug 2013 11:42:53 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B37102947; Sun, 25 Aug 2013 11:42:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7PBgr3I044456; Sun, 25 Aug 2013 11:42:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7PBgrG2044454; Sun, 25 Aug 2013 11:42:53 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201308251142.r7PBgrG2044454@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 25 Aug 2013 11:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254849 - in head: bin/sh tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2013 11:42:53 -0000 Author: jilles Date: Sun Aug 25 11:42:53 2013 New Revision: 254849 URL: http://svnweb.freebsd.org/changeset/base/254849 Log: sh: Recognize "--" as end of options in alias builtin. Aliases starting with "-" (which are non-POSIX) will need to be preceded by an alias not starting with "-" or the newly added "--". Added: head/tools/regression/bin/sh/builtins/alias4.0 (contents, props changed) Modified: head/bin/sh/alias.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Sun Aug 25 11:34:37 2013 (r254848) +++ head/bin/sh/alias.c Sun Aug 25 11:42:53 2013 (r254849) @@ -237,17 +237,19 @@ printaliases(void) } int -aliascmd(int argc, char **argv) +aliascmd(int argc __unused, char **argv __unused) { char *n, *v; int ret = 0; struct alias *ap; - if (argc == 1) { + nextopt(""); + + if (*argptr == NULL) { printaliases(); return (0); } - while ((n = *++argv) != NULL) { + while ((n = *argptr++) != NULL) { if ((v = strchr(n+1, '=')) == NULL) /* n+1: funny ksh stuff */ if ((ap = lookupalias(n, 0)) == NULL) { warning("%s: not found", n); Added: head/tools/regression/bin/sh/builtins/alias4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/alias4.0 Sun Aug 25 11:42:53 2013 (r254849) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +unalias -a +alias --