]> git.mdlowis.com Git - projs/tide.git/commitdiff
convert path to absolute path
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 15 May 2018 02:09:08 +0000 (22:09 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 15 May 2018 02:09:08 +0000 (22:09 -0400)
lib/x11.c
tide.c

index bea6bef84f0989ad6a9281e67462e8b0a7e20217..f4ac25f6361705f0e5dc53598a60715fe5f2436d 100644 (file)
--- 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 1b03ca877188f947e5173855f670ab4ddae2880f..23ac485b831759991544ca04e7166ea9af72fcd9 100644 (file)
--- 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 */