diff options
author | pommicket <pommicket@gmail.com> | 2023-09-24 09:59:46 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-24 09:59:46 -0400 |
commit | bf00aba72e89d4005c8a3b405bffa4c0a11d9c96 (patch) | |
tree | 85f9002046b6013126e8f10c5f9fda16d2184cfd /config.c | |
parent | 4d247b00b04ad143ab6a0da4b94bebeb5be7320d (diff) |
fix escaped quotes in strings
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -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); } |