From 11b50663dc489b7ec8cb1c8774d9bda2c7acac3b Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Mon, 1 Feb 2021 12:33:27 -0500 Subject: full C syntax highlighting --- ui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui.c') diff --git a/ui.c b/ui.c index 26f56cd..3c16be5 100644 --- a/ui.c +++ b/ui.c @@ -382,7 +382,9 @@ static char *file_selector_update(Ted *ted, FileSelector *fs) { size_t path_size = strlen(name) + strlen(cwd) + 3; char *path = ted_calloc(ted, 1, path_size); if (path) { - snprintf(path, path_size - 1, "%s%s%s", cwd, PATH_SEPARATOR_STR, name); + snprintf(path, path_size - 1, "%s%s%s", cwd, + cwd[strlen(cwd) - 1] == PATH_SEPARATOR ? "" : PATH_SEPARATOR_STR, + name); entries[i].path = path; entries[i].type = fs_path_type(path); } else { -- cgit v1.2.3