aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-19 23:19:55 +0100
committerMattias Andrée <maandree@kth.se>2023-01-19 23:19:55 +0100
commitbd1d4bcfe524527ff08894fe312c5f76471a27e4 (patch)
tree2e4a76b02ad5e06ca1d8c61e62a081c6250f9748
parentAdd encoding parsing and m fix libfonts_parse_alias_line (diff)
downloadlibfonts-bd1d4bcfe524527ff08894fe312c5f76471a27e4.tar.gz
libfonts-bd1d4bcfe524527ff08894fe312c5f76471a27e4.tar.bz2
libfonts-bd1d4bcfe524527ff08894fe312c5f76471a27e4.tar.xz
libfonts_parse_encoding_line: fix whitespace compression
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--libfonts_parse_encoding_line.c4
1 files 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';