public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
580+ messages / 1 participants
[nested] [flat]

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-05 21:03 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-05 21:03 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators):

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

In lexi.c, when an identifier matches the typedef list, the code
sets last_u_d = true before jumping to found_typename.  This flag
tells the lexer that the next operator should be treated as unary,
which is correct for type names (e.g., "Datum *x" needs * to be
unary, not multiplication).

However, found_typename has a guard that recognizes when a typedef
name appears after "." or "->": in that case, the name is a struct
member, not a type, so it's returned as a plain identifier.  The
problem is that last_u_d has already been set to true and is never
corrected.  This causes the next operator (e.g., "!=") to be
misclassified as unary, which suppresses the space after it.

To fix, only set last_u_d when the token won't be caught by the
guard, i.e., when it will actually be treated as a type name.

This also explains why "==" was not affected: the "==" case always
returns binary_op regardless of last_u_d, while "!=" checks
last_u_d to decide.
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--k2Vi/uo5iFea1Gni
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=v1-0002-run-pgindent.patch



^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread

* [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef.
@ 2026-05-06 16:02 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 580+ messages in thread

From: Nathan Bossart @ 2026-05-06 16:02 UTC (permalink / raw)

When a struct member name matches a registered typedef, pgindent
removes the space after "!=" (and some other operators), like so:

    entry->dsh.dsa_handle !=DSA_HANDLE_INVALID

The problem is that the related code in lexi.c sets last_u_d to
true before jumping to found_typename, causing the next operator to
be classified as unary and suppressing the following space.  This
is correct for type names, but not for struct members.  For
example, "Datum *x" needs "*" to be unary to suppress the space
before "x".  To fix, only set last_u_d before jumping to
found_typename if the typedef name doesn't appear after "." or
"->".

Note that this does not bump INDENT_VERSION.  We'll do that just
once after some other changes to pg_bsd_indent are committed.

Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/aS9hkwnkWf3dZIA_%40nathan
---
 src/tools/pg_bsd_indent/lexi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/pg_bsd_indent/lexi.c b/src/tools/pg_bsd_indent/lexi.c
index 943bf7ce6b0..e846188d6f4 100644
--- a/src/tools/pg_bsd_indent/lexi.c
+++ b/src/tools/pg_bsd_indent/lexi.c
@@ -363,7 +363,8 @@ lexi(struct parser_state *state)
 		  bsearch(s_token, typenames, typename_top + 1,
 		    sizeof(typenames[0]), strcmp_type))) {
 		state->keyword = 4;	/* a type name */
-		state->last_u_d = true;
+		if (state->last_token != period && state->last_token != unary_op)
+		    state->last_u_d = true;
 	        goto found_typename;
 	    }
 	} else {			/* we have a keyword */
-- 
2.50.1 (Apple Git-155)


--1t/m2eK+hqhKaVEb--





^ permalink  raw  reply  [nested|flat] 580+ messages in thread


end of thread, other threads:[~2026-05-06 16:02 UTC | newest]

Thread overview: 580+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-05 21:03 [PATCH v1 1/2] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>
2026-05-06 16:02 [PATCH v2 1/1] pgindent: Fix spacing after != when member name matches typedef. Nathan Bossart <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox