From bf00aba72e89d4005c8a3b405bffa4c0a11d9c96 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 24 Sep 2023 09:59:46 -0400 Subject: fix escaped quotes in strings --- base.h | 1 + config.c | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/base.h b/base.h index da01fdc..cf20670 100644 --- a/base.h +++ b/base.h @@ -9,6 +9,7 @@ #ifndef DEBUG #define NDEBUG 1 #endif +#define _FILE_OFFSET_BITS 64 #ifndef _GNU_SOURCE #define _GNU_SOURCE diff --git a/config.c b/config.c index 8f8982a..0098095 100644 --- a/config.c +++ b/config.c @@ -642,15 +642,13 @@ static int config_part_qsort_cmp(const void *av, const void *bv) { static char *config_read_string(Ted *ted, ConfigReader *cfg, char **ptext) { char *p; - int backslashes = 0; u32 start_line = cfg->line_number; char delimiter = **ptext; char *start = *ptext + 1; char *str = NULL; - for (p = start; ; ++p) { + for (p = start; *p != delimiter; ++p) { switch (*p) { case '\\': - ++backslashes; ++p; switch (*p) { case '\\': @@ -686,8 +684,6 @@ static char *config_read_string(Ted *ted, ConfigReader *cfg, char **ptext) { arr_clear(str); return NULL; } - if (*p == delimiter) - break; arr_add(str, *p); } -- cgit v1.2.3