From owner-svn-src-head@freebsd.org Wed Aug 15 18:19:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3165106B1EC; Wed, 15 Aug 2018 18:19:46 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8926C726A2; Wed, 15 Aug 2018 18:19:46 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 658FA611C; Wed, 15 Aug 2018 18:19:46 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FIJkZB084413; Wed, 15 Aug 2018 18:19:46 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FIJjs4084410; Wed, 15 Aug 2018 18:19:45 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201808151819.w7FIJjs4084410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Wed, 15 Aug 2018 18:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337862 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 337862 X-SVN-Commit-Repository: base 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.27 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: Wed, 15 Aug 2018 18:19:47 -0000 Author: pstef Date: Wed Aug 15 18:19:45 2018 New Revision: 337862 URL: https://svnweb.freebsd.org/changeset/base/337862 Log: indent(1): bug fix after r336333 The bug was that isalnum() is not exactly equivalent to previous code which also allowed characters "$" and "_", so check for those explicitly. Reported by: tuexen@ Modified: head/usr.bin/indent/lexi.c head/usr.bin/indent/tests/float.0 head/usr.bin/indent/tests/float.0.stdout Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Wed Aug 15 17:41:19 2018 (r337861) +++ head/usr.bin/indent/lexi.c Wed Aug 15 18:19:45 2018 (r337862) @@ -193,6 +193,7 @@ lexi(struct parser_state *state) /* Scan an alphanumeric token */ if (isalnum((unsigned char)*buf_ptr) || + *buf_ptr == '_' || *buf_ptr == '$' || (buf_ptr[0] == '.' && isdigit((unsigned char)buf_ptr[1]))) { /* * we have a character or number @@ -222,7 +223,7 @@ lexi(struct parser_state *state) else while (isalnum((unsigned char)*buf_ptr) || *buf_ptr == BACKSLASH || - *buf_ptr == '_') { + *buf_ptr == '_' || *buf_ptr == '$') { /* fill_buffer() terminates buffer with newline */ if (*buf_ptr == BACKSLASH) { if (*(buf_ptr + 1) == '\n') { Modified: head/usr.bin/indent/tests/float.0 ============================================================================== --- head/usr.bin/indent/tests/float.0 Wed Aug 15 17:41:19 2018 (r337861) +++ head/usr.bin/indent/tests/float.0 Wed Aug 15 18:19:45 2018 (r337862) @@ -4,4 +4,5 @@ void t(void) { double y[] = {0x1P+9F, 0.3, .1, 1.2f, 0xa.p01f, 3.14f, 2.L}; int z = 0b0101; DO_NOTHING; + x._y = 5; } Modified: head/usr.bin/indent/tests/float.0.stdout ============================================================================== --- head/usr.bin/indent/tests/float.0.stdout Wed Aug 15 17:41:19 2018 (r337861) +++ head/usr.bin/indent/tests/float.0.stdout Wed Aug 15 18:19:45 2018 (r337862) @@ -6,4 +6,5 @@ t(void) double y[] = {0x1P+9F, 0.3, .1, 1.2f, 0xa.p01f, 3.14f, 2.L}; int z = 0b0101; DO_NOTHING; + x._y = 5; }