From 1ac5927a8151e700266867d47d521473a9151122 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 14 May 2018 22:09:08 -0400 Subject: [PATCH] convert path to absolute path --- lib/x11.c | 2 +- tide.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/x11.c b/lib/x11.c index bea6bef..f4ac25f 100644 --- a/lib/x11.c +++ b/lib/x11.c @@ -572,7 +572,7 @@ void win_save(char* path) { View* view = win_view(EDIT); if (!path) path = view->buffer.path; if (!path) return; - path = strdup(path); + path = realpath(path, NULL); free(view->buffer.path); view->buffer.path = path; buf_save(&(view->buffer)); diff --git a/tide.c b/tide.c index 1b03ca8..23ac485 100644 --- a/tide.c +++ b/tide.c @@ -498,8 +498,9 @@ int main(int argc, char** argv) { /* if we still have args left we're going to open it in this instance */ if (*argv) { - view_init(win_view(EDIT), *argv); - win_prop_set("TIDE_FILE", "file", *argv); + char* path = realpath(*argv, NULL); + view_init(win_view(EDIT), path); + win_prop_set("TIDE_FILE", "file", path); } /* now create the window and start the event loop */ -- 2.49.0