From 384e6945ac64dba1c41d6ca714a6d7750d92ddb2 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 13 Jan 2025 11:56:53 +0900 Subject: [PATCH] [ruby/date] Enclose dangling else in braces and fix -Wmisleading-indentation ``` date_strptime.c:253:324: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] 253 | ...((VALUE)RUBY_Qtrue)); return 0; } while (0); si += l; } while (0); | ^ date_strptime.c:252:7: note: previous statement is here 252 | else | ^ ``` https://github.com/ruby/date/commit/41aed5b746 --- ext/date/date_strptime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/date/date_strptime.c b/ext/date/date_strptime.c index da58c21a76..f1c8201de8 100644 --- a/ext/date/date_strptime.c +++ b/ext/date/date_strptime.c @@ -122,8 +122,9 @@ do { \ do { \ size_t l; \ l = read_digits(&str[si], slen - si, &n, w); \ - if (l == 0) \ + if (l == 0) { \ fail(); \ + } \ si += l; \ } while (0)