Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Apr 2010 13:16:18 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r207063 - stable/8/usr.bin/indent
Message-ID:  <201004221316.o3MDGIPF086893@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Apr 22 13:16:18 2010
New Revision: 207063
URL: http://svn.freebsd.org/changeset/base/207063

Log:
  MFC r206687: indent(1): don't treat bare '_t' as a type name with -ta

Modified:
  stable/8/usr.bin/indent/lexi.c
Directory Properties:
  stable/8/usr.bin/indent/   (props changed)

Modified: stable/8/usr.bin/indent/lexi.c
==============================================================================
--- stable/8/usr.bin/indent/lexi.c	Thu Apr 22 12:50:01 2010	(r207062)
+++ stable/8/usr.bin/indent/lexi.c	Thu Apr 22 13:16:18 2010	(r207063)
@@ -251,9 +251,10 @@ lexi(void)
 
 	if (auto_typedefs) {
 	    const char *q = s_token;
+	    size_t q_len = strlen(q);
 	    /* Check if we have an "_t" in the end */
-	    if (q[0] && q[1] &&
-	        (strcmp(q + strlen(q) - 2, "_t") == 0)) {
+	    if (q_len > 2 &&
+	        (strcmp(q + q_len - 2, "_t") == 0)) {
 	        ps.its_a_keyword = true;
 		ps.last_u_d = true;
 	        goto found_auto_typedef;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004221316.o3MDGIPF086893>