From b9c640dbeeef6090eff55a65b01c8b19b36a43a9 Mon Sep 17 00:00:00 2001 From: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com> Date: Thu, 7 Mar 2024 17:25:11 -0500 Subject: [PATCH] micro: accept relative file paths Removed hugo from the `all` make step since we're not using it right now. --- Makefile | 2 +- external/micro/wanix_vendor.patch | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 90d16c1..dbc378b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION=0.2dev DEBUG?=false -all: kernel shell build micro hugo +all: kernel shell build micro dev: all go run ./dev diff --git a/external/micro/wanix_vendor.patch b/external/micro/wanix_vendor.patch index 68504e9..fcffa9e 100644 --- a/external/micro/wanix_vendor.patch +++ b/external/micro/wanix_vendor.patch @@ -160,3 +160,19 @@ index 3e6756bc..9f71377b 100644 } return } +diff --git a/internal/buffer/buffer.go b/internal/buffer/buffer.go +index dc4d037f..8e09ed32 100644 +--- a/internal/buffer/buffer.go ++++ b/internal/buffer/buffer.go +@@ -234,6 +234,11 @@ func NewBufferFromFileAtLoc(path string, btype BufType, cursorLoc Loc) (*Buffer, + return nil, err + } + ++ filename, err = filepath.Abs(filename) ++ if err != nil { ++ return nil, err ++ } ++ + f, err := os.OpenFile(filename, os.O_WRONLY, 0) + readonly := os.IsPermission(err) + f.Close()