From 786718602b46a04753820fecb5b1e8e36f9e1c87 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Wed, 29 Jan 2020 22:01:29 -0800 Subject: [PATCH] Actually fixed cache entries that contain a lf --- src/wofi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/wofi.c b/src/wofi.c index 15d99b2..aa06c60 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -474,17 +474,15 @@ void wofi_write_cache(struct mode* mode, const char* _cmd) { if(lf != NULL) { *lf = 0; } - char* entry = remove_escapes(line); if(space != NULL && strcmp(cmd, space + 1) == 0) { struct cache_line* node = malloc(sizeof(struct cache_line)); - uint64_t count = strtol(entry, NULL, 10) + 1; + uint64_t count = strtol(line, NULL, 10) + 1; char num[6]; snprintf(num, 5, "%" PRIu64, count); node->line = utils_concat(4, num, " ", cmd, "\n"); inc_count = true; wl_list_insert(&lines, &node->link); } - free(entry); } free(line); line = NULL; @@ -496,13 +494,11 @@ void wofi_write_cache(struct mode* mode, const char* _cmd) { if(nl != NULL) { *nl = 0; } - char* entry = remove_escapes(line); if(space == NULL || strcmp(cmd, space + 1) != 0) { struct cache_line* node = malloc(sizeof(struct cache_line)); - node->line = utils_concat(2, entry, "\n"); + node->line = utils_concat(2, line, "\n"); wl_list_insert(&lines, &node->link); } - free(entry); } free(line); fclose(file);