From owner-svn-src-all@FreeBSD.ORG Fri May 9 13:32:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84A2ABAE; Fri, 9 May 2014 13:32:37 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71F526E1; Fri, 9 May 2014 13:32:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49DWbnQ064740; Fri, 9 May 2014 13:32:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49DWbuW064738; Fri, 9 May 2014 13:32:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405091332.s49DWbuW064738@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 9 May 2014 13:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265773 - in head/bin/sh: . tests/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.18 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: Fri, 09 May 2014 13:32:37 -0000 Author: jilles Date: Fri May 9 13:32:36 2014 New Revision: 265773 URL: http://svnweb.freebsd.org/changeset/base/265773 Log: sh: Send getopts error messages to stderr, not stdout. Adjust a testcase for this change. Modified: head/bin/sh/options.c head/bin/sh/tests/builtins/getopts1.0 Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Fri May 9 13:27:30 2014 (r265772) +++ head/bin/sh/options.c Fri May 9 13:32:36 2014 (r265773) @@ -474,7 +474,7 @@ atend: err |= setvarsafe("OPTARG", s, 0); } else { - out1fmt("Illegal option -%c\n", c); + out2fmt_flush("Illegal option -%c\n", c); INTOFF; (void) unsetvar("OPTARG"); INTON; @@ -495,7 +495,7 @@ atend: c = ':'; } else { - out1fmt("No arg for -%c option\n", c); + out2fmt_flush("No arg for -%c option\n", c); INTOFF; (void) unsetvar("OPTARG"); INTON; Modified: head/bin/sh/tests/builtins/getopts1.0 ============================================================================== --- head/bin/sh/tests/builtins/getopts1.0 Fri May 9 13:27:30 2014 (r265772) +++ head/bin/sh/tests/builtins/getopts1.0 Fri May 9 13:32:36 2014 (r265773) @@ -15,7 +15,7 @@ printf -- '-2-\n' set -- -ab getopts "ab:" OPTION echo ${OPTION} -getopts "ab:" OPTION +getopts "ab:" OPTION 3>&2 2>&1 >&3 3>&- echo ${OPTION} # The 'shift' is aimed at causing an error.