From 44bff58aa83e57dd9db47aca10e416c6c341fe6b Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 7 Jun 2021 11:25:35 +1000 Subject: [PATCH] [common] option: ignore non-typeable ascii characters Under windows text editors like to default to saving in UTF8 with a byte order mask prefix preventing proper parsing of any option that is on the first line of the file. Since the configuration file is only intended to be plain ascii this change ignores all non-ascii characters solving this issue. --- common/src/option.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/src/option.c b/common/src/option.c index 3e6dc325..20ef67bf 100644 --- a/common/src/option.c +++ b/common/src/option.c @@ -397,6 +397,10 @@ bool option_load(const char * filename) continue; comment = false; + // ignore non-typeable ascii characters + if (c < 32 || c > 126) + continue; + switch(c) { case '[':