From owner-cvs-src@FreeBSD.ORG Sun Apr 9 12:21:21 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 434F016A400; Sun, 9 Apr 2006 12:21:21 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 126E243D48; Sun, 9 Apr 2006 12:21:21 +0000 (GMT) (envelope-from stefanf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k39CLKHE048791; Sun, 9 Apr 2006 12:21:20 GMT (envelope-from stefanf@repoman.freebsd.org) Received: (from stefanf@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k39CLKou048790; Sun, 9 Apr 2006 12:21:20 GMT (envelope-from stefanf) Message-Id: <200604091221.k39CLKou048790@repoman.freebsd.org> From: Stefan Farfeleder Date: Sun, 9 Apr 2006 12:21:20 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/bin/sh exec.c exec.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2006 12:21:21 -0000 stefanf 2006-04-09 12:21:20 UTC FreeBSD src repository Modified files: bin/sh exec.c exec.h Log: Implement some of the differences between special built-ins and other builtins demanded by POSIX. - A redirection error is only fatal (meaning the execution of a shell script is terminated) for special built-ins. Previously it was fatal for all shell builtins, causing problems like the one reported in PR 88845. - Variable assignments remain in effect for special built-ins. - Option or operand errors are only fatal for special built-ins. This change also makes errors from 'fc' non-fatal (I could not find any reasons for this behaviour). Somewhat independently from the above down-grade the error handling in the shift built-in if the operand is bigger than $# from an error() call (which is now fatal) to a return 1. I'm not sure if this should be considered a POSIX "operand error", however this change is needed for now as we trigger that error while building libncurses. Comparing with other shells, zsh does the same as our sh before this change (write a diagnostic, return 1), bash behaves as our sh after this commit (no diagnostic, return 1) and ksh93 and NetBSD's sh treat it as a fatal error. Revision Changes Path 1.29 +11 -4 src/bin/sh/exec.c 1.15 +2 -1 src/bin/sh/exec.h