summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-12-07 18:09:54 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-12-07 18:09:54 -0800
commit0d2837162ef0e54647485eee2ba4b88012fbb1b4 (patch)
tree96bdbf365ad8f7fc1d194ded7b95a39b44714a0a
parent6d5cb0110b8b21ce94a52993e6e175266a4153fb (diff)
Fix C23 build by renaming variable 'true'
Reported by gcc 13.2 with -std=gnu2x: xprop.c: In function ‘Handle_Question_Mark’: xprop.c:1291:10: error: expected identifier or ‘(’ before ‘true’ 1291 | long true; | ^~~~ xprop.c:1293:49: error: lvalue required as unary ‘&’ operand 1293 | dformat = Scan_Exp(dformat, thunks, format, &true); | ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xprop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xprop.c b/xprop.c
index 4a31804..df45477 100644
--- a/xprop.c
+++ b/xprop.c
@@ -1288,15 +1288,15 @@ Scan_Exp (const char *string, thunk *thunks, const char *format, long *value)
static const char *
Handle_Question_Mark (const char *dformat, thunk *thunks, const char *format)
{
- long true;
+ long is_true;
- dformat = Scan_Exp(dformat, thunks, format, &true);
+ dformat = Scan_Exp(dformat, thunks, format, &is_true);
if (*dformat != '(')
Fatal_Error("Bad conditional: '(' expected: %s.", dformat);
++dformat;
- if (!true)
+ if (!is_true)
dformat = Skip_Past_Right_Paren(dformat);
return dformat;