From 4a9d68bf7f3a523c675d59bd14fdf987cf969c12 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 4 Dec 2023 15:41:09 -0500 Subject: [PATCH] symbol parsing follow-up --- src/symbols.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/symbols.c b/src/symbols.c index 3d201ad7f..9690c4004 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -764,19 +764,19 @@ boolean parsesymbols(register char *opts, int which_set) { int val; - unsigned i; - char *symname, *strval, *ch = opts, + char *symname, *strval, *ch, *first_unquoted_comma = 0, *first_unquoted_colon = 0; const struct symparse *symp; boolean is_glyph = FALSE; /* are there any commas or colons that aren't quoted? */ - for (i = 0; i < strlen(opts); ++i) { + for (ch = opts + 1; *ch; ++ch) { char *prech, *postch; - ch++; /* we never want to match on the first char, so this is ok */ prech = ch - 1; postch = ch + 1; + if (!*postch) + break; if (*ch == ',') { if (*prech == '\'' && *postch == '\'') continue;