From owner-svn-src-all@FreeBSD.ORG Tue Nov 23 20:46:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FC311065698; Tue, 23 Nov 2010 20:46:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4158FC08; Tue, 23 Nov 2010 20:46:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANKk61Y042758; Tue, 23 Nov 2010 20:46:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANKk6Q1042756; Tue, 23 Nov 2010 20:46:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011232046.oANKk6Q1042756@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 23 Nov 2010 20:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215766 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 23 Nov 2010 20:46:06 -0000 Author: jilles Date: Tue Nov 23 20:46:06 2010 New Revision: 215766 URL: http://svn.freebsd.org/changeset/base/215766 Log: sh: Pass multiple bytes at a time to lex. This speeds up the expansion/arith6.0 test considerably. Modified: head/bin/sh/arith_lex.l Modified: head/bin/sh/arith_lex.l ============================================================================== --- head/bin/sh/arith_lex.l Tue Nov 23 20:28:21 2010 (r215765) +++ head/bin/sh/arith_lex.l Tue Nov 23 20:46:06 2010 (r215766) @@ -53,7 +53,15 @@ int yylex(void); #undef YY_INPUT #define YY_INPUT(buf,result,max) \ - result = (*buf = *arith_buf++) ? 1 : YY_NULL; + do { \ + result = strnlen(arith_buf, max); \ + if (result == 0) \ + result = YY_NULL; \ + else { \ + memcpy(buf, arith_buf, result); \ + arith_buf += result; \ + } \ + } while (0); #define YY_NO_UNPUT #define YY_NO_INPUT %}