summaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-01 12:33:27 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-01 12:33:27 -0500
commit11b50663dc489b7ec8cb1c8774d9bda2c7acac3b (patch)
treeaa604b767286c86b21b6fef851f0c74e8dfc0acb /ui.c
parentdba51f5c1b7ac895239d2909358b323a92b77644 (diff)
full C syntax highlighting
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c4
1 files changed, 3 insertions, 1 deletions
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 {