Skip to content

Commit

Permalink
micro: accept relative file paths (#132)
Browse files Browse the repository at this point in the history
Removed hugo from the `all` make step since we're not using it right now.
  • Loading branch information
Parzival-3141 authored Mar 8, 2024
1 parent 75d2bc2 commit d352c94
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions external/micro/wanix_vendor.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit d352c94

Please sign in to comment.