From f5073ed39f8a244fe70ba2294aa8dec18bac39d0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 23 Mar 2025 19:48:58 +0100 Subject: Add ; as option delimiter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/gamma.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gamma.c') diff --git a/src/gamma.c b/src/gamma.c index a66f2b2..44042d0 100644 --- a/src/gamma.c +++ b/src/gamma.c @@ -63,9 +63,12 @@ try_start(const struct gamma_method *method, GAMMA_STATE **state_out, struct con goto set_option_fail; /* Set method options from command line */ - while (args) { - next_arg = strchr(args, ':'); - if (next_arg) + for (; args && *args; args = next_arg) { + if (!strncasecmp(args, "display=", sizeof("display=") - 1U)) + next_arg = &args[strcspn(args, ";")]; + else + next_arg = &args[strcspn(args, ";:")]; + if (*next_arg) *next_arg++ = '\0'; key = args; @@ -78,8 +81,6 @@ try_start(const struct gamma_method *method, GAMMA_STATE **state_out, struct con if (method->set_option(*state_out, key, value) < 0) goto set_option_fail; - - args = next_arg; } /* Start method */ -- cgit v1.2.3-70-g09d2