From owner-svn-src-head@FreeBSD.ORG Fri Aug 30 10:45:03 2013 Return-Path: Delivered-To: svn-src-head@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 ESMTP id 063F3530; Fri, 30 Aug 2013 10:45:03 +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 E7E4029F0; Fri, 30 Aug 2013 10:45:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7UAj2Sn055925; Fri, 30 Aug 2013 10:45:02 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7UAj2G5055923; Fri, 30 Aug 2013 10:45:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201308301045.r7UAj2G5055923@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 30 Aug 2013 10:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255068 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2013 10:45:03 -0000 Author: jilles Date: Fri Aug 30 10:45:02 2013 New Revision: 255068 URL: http://svnweb.freebsd.org/changeset/base/255068 Log: sh: Cast -1 to pointer rather than pointer to variable of wrong type. NEOF needs to be a non-null pointer distinct from valid union node pointers. It is not dereferenced. The new NEOF is much like SIG_ERR except that it is an object pointer instead of a function pointer. The variable tokpushback can now be static. Modified: head/bin/sh/parser.c head/bin/sh/parser.h Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Fri Aug 30 10:39:56 2013 (r255067) +++ head/bin/sh/parser.c Fri Aug 30 10:45:02 2013 (r255068) @@ -96,7 +96,7 @@ static struct heredoc *heredoclist; /* l static int doprompt; /* if set, prompt the user */ static int needprompt; /* true if interactive and at start of line */ static int lasttoken; /* last token read */ -int tokpushback; /* last token pushed back */ +static int tokpushback; /* last token pushed back */ static char *wordtext; /* text of last word returned by readtoken */ static int checkkwd; static struct nodelist *backquotelist; Modified: head/bin/sh/parser.h ============================================================================== --- head/bin/sh/parser.h Fri Aug 30 10:39:56 2013 (r255067) +++ head/bin/sh/parser.h Fri Aug 30 10:45:02 2013 (r255068) @@ -68,11 +68,9 @@ /* * NEOF is returned by parsecmd when it encounters an end of file. It - * must be distinct from NULL, so we use the address of a variable that - * happens to be handy. + * must be distinct from NULL. */ -extern int tokpushback; -#define NEOF ((union node *)&tokpushback) +#define NEOF ((union node *)-1) extern int whichprompt; /* 1 == PS1, 2 == PS2 */ extern const char *const parsekwd[];