summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/command.c b/command.c
index 684d30a..9bd58bc 100644
--- a/command.c
+++ b/command.c
@@ -157,14 +157,12 @@ void command_execute(Ted *ted, Command c, i64 argument) {
break;
case MENU_OPEN: {
TextBuffer *open_to = &ted->main_buffer;
- String32 filename32 = {.str = buffer->lines[0].str, .len = buffer->lines[0].len};
-
- char *filename_cstr = str32_to_utf8_cstr(filename32);
+ char *filename_cstr = str32_to_utf8_cstr(buffer_get_line(&ted->line_buffer, 0));
if (filename_cstr) {
buffer_load_file(open_to, filename_cstr);
buffer = open_to;
if (buffer_haserr(open_to)) {
- // @TODO: something better
+ // @TODO: something
}
free(filename_cstr);
menu_close(ted, true);