From bd1d4bcfe524527ff08894fe312c5f76471a27e4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Jan 2023 23:19:55 +0100 Subject: libfonts_parse_encoding_line: fix whitespace compression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libfonts_parse_encoding_line.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libfonts_parse_encoding_line.c b/libfonts_parse_encoding_line.c index a4d876b..1c96074 100644 --- a/libfonts_parse_encoding_line.c +++ b/libfonts_parse_encoding_line.c @@ -33,7 +33,7 @@ get_string(const char *s, const char **endp) char *ret; for (len = 1, p = &s[1]; *p && *p != '\n' && *p != '#'; p++) - len += (!isblank(*p) || isblank(p[-1])); + len += (!isblank(*p) || !isblank(p[-1])); ret = malloc(len + 1); if (!ret) @@ -43,7 +43,7 @@ get_string(const char *s, const char **endp) for (*r++ = *s++; *s && *s != '\n' && *s != '#'; s++) { if (!isblank(*s)) *r++ = *s; - else if (isblank(s[-1])) + else if (!isblank(s[-1])) *r++ = ' '; } *r = '\0'; -- cgit v1.2.3-70-g09d2