diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-01 12:33:27 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-01 12:33:27 -0500 |
commit | 11b50663dc489b7ec8cb1c8774d9bda2c7acac3b (patch) | |
tree | aa604b767286c86b21b6fef851f0c74e8dfc0acb /ui.c | |
parent | dba51f5c1b7ac895239d2909358b323a92b77644 (diff) |
full C syntax highlighting
Diffstat (limited to 'ui.c')
-rw-r--r-- | ui.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 { |