summaryrefslogtreecommitdiffstats
path: root/usr.bin/indent/lexi.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/indent/lexi.c')
-rw-r--r--usr.bin/indent/lexi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c
index 60fc1ae..b3604c6 100644
--- a/usr.bin/indent/lexi.c
+++ b/usr.bin/indent/lexi.c
@@ -249,6 +249,18 @@ lexi(void)
last_code = ident; /* Remember that this is the code we will
* return */
+ 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_len > 2 &&
+ (strcmp(q + q_len - 2, "_t") == 0)) {
+ ps.its_a_keyword = true;
+ ps.last_u_d = true;
+ goto found_auto_typedef;
+ }
+ }
+
/*
* This loop will check if the token is a keyword.
*/
@@ -285,6 +297,7 @@ lexi(void)
/* FALLTHROUGH */
case 4: /* one of the declaration keywords */
+ found_auto_typedef:
if (ps.p_l_follow) {
ps.cast_mask |= (1 << ps.p_l_follow) & ~ps.sizeof_mask;
break; /* inside parens: cast, param list or sizeof */
OpenPOWER on IntegriCloud