From a690695ad30ff689cdfebe20999aee34898889cd Mon Sep 17 00:00:00 2001 From: Anders L Holst <36549217+sortraev@users.noreply.github.com> Date: Tue, 8 Oct 2024 12:09:28 +0200 Subject: [PATCH] Fix blank lines in tuning files (#2185) Since `fgets` stores the terminating newline (if any), this should also be checked in order to allow completely blank lines. --- rts/c/tuning.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/c/tuning.h b/rts/c/tuning.h index feefae9228..cde8cc7716 100644 --- a/rts/c/tuning.h +++ b/rts/c/tuning.h @@ -2,7 +2,7 @@ int is_blank_line_or_comment(const char *s) { - size_t i = strspn(s, " \t"); + size_t i = strspn(s, " \t\n"); return s[i] == '\0' || // Line is blank. strncmp(s + i, "--", 2) == 0; // Line is comment. }