summaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-04-13 14:37:24 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2021-04-13 14:37:24 -0400
commit77cfc38b57626e2c5a0b3549407c13acecb62d20 (patch)
tree2dd9bf9761ee6b2478ab39503995b35b72683f4e /ui.c
parent69789c042460e012ec3054cc2e6ceeff25e394b9 (diff)
improve tag generation (don't just look at files in the cwd)
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ui.c b/ui.c
index dc413c3..0b6a0a0 100644
--- a/ui.c
+++ b/ui.c
@@ -283,7 +283,7 @@ static Status file_selector_cd_(Ted *ted, FileSelector *fs, char const *path, in
if (path[0] == PATH_SEPARATOR) {
char new_cwd[TED_PATH_MAX];
// necessary because the full path of \ on windows isn't just \, it's c:\ or something
- ted_full_path(ted, PATH_SEPARATOR_STR, new_cwd, sizeof new_cwd);
+ ted_path_full(ted, PATH_SEPARATOR_STR, new_cwd, sizeof new_cwd);
strcpy(cwd, new_cwd);
path += 1;
}
@@ -371,7 +371,7 @@ static char *file_selector_update(Ted *ted, FileSelector *fs) {
if (option_chosen) {
char path[TED_PATH_MAX];
- strbuf_printf(path, "%s%s%s", cwd, cwd[strlen(cwd)-1] == PATH_SEPARATOR ? "" : PATH_SEPARATOR_STR, option_chosen);
+ path_full(cwd, option_chosen, path, sizeof path);
char *ret = NULL;
switch (fs_path_type(path)) {
@@ -451,9 +451,7 @@ 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,
- cwd[strlen(cwd) - 1] == PATH_SEPARATOR ? "" : PATH_SEPARATOR_STR,
- name);
+ path_full(cwd, name, path, path_size);
entries[i].path = path;
} else {
entries[i].path = NULL; // what can we do?