aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/navigator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/navigator.c b/src/navigator.c
index b03926c..6cc3cce 100644
--- a/src/navigator.c
+++ b/src/navigator.c
@@ -60,8 +60,10 @@ static int add_item(struct imv_navigator *nav, const char *path)
}
nav->paths = new_paths;
}
- if ((nav->paths[nav->num_paths] = strndup(path, PATH_MAX)) == NULL) {
- return 1;
+ if ((nav->paths[nav->num_paths] = realpath(path, NULL)) == NULL) {
+ if ((nav->paths[nav->num_paths] = strndup(path, PATH_MAX)) == NULL) {
+ return 1;
+ }
}
nav->num_paths += 1;
if (nav->num_paths == 1) {