From ea849862a85e1751206c20254e9126cf3e8096b5 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 11 May 2023 22:09:49 +0200 Subject: Fix languages - Enumerate windows on screen. - Build with optimizations. --- src/main/cmds.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/main/cmds.c') diff --git a/src/main/cmds.c b/src/main/cmds.c index 48088b1..b7f7011 100644 --- a/src/main/cmds.c +++ b/src/main/cmds.c @@ -8,6 +8,7 @@ #include "dged/buffers.h" #include "dged/command.h" #include "dged/minibuffer.h" +#include "dged/path.h" #include "dged/settings.h" #include "bindings.h" @@ -48,15 +49,9 @@ int32_t find_file(struct command_ctx ctx, int argc, const char *argv[]) { return 1; } - const char *filename = realpath(pth, NULL); - if (filename == NULL) { - filename = pth; - } + const char *filename = to_abspath(pth); struct buffer *b = buffers_find_by_filename(ctx.buffers, filename); - - if (filename != pth) { - free((char *)filename); - } + free((char *)filename); if (b == NULL) { b = buffers_add(ctx.buffers, buffer_from_file((char *)pth)); -- cgit v1.2.3