Author: avg
Date: Fri Apr 23 14:35:03 2010
New Revision: 207117
URL: http://svn.freebsd.org/changeset/base/207117

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

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

Modified: stable/7/usr.bin/indent/lexi.c
==============================================================================
--- stable/7/usr.bin/indent/lexi.c      Fri Apr 23 14:32:58 2010        
(r207116)
+++ stable/7/usr.bin/indent/lexi.c      Fri Apr 23 14:35:03 2010        
(r207117)
@@ -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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to