diff options
| -rw-r--r-- | Makefile | 11 | ||||
| -rw-r--r-- | todo/open.ha | 1 |
2 files changed, 10 insertions, 2 deletions
@@ -1,9 +1,16 @@ EXE := bunnytask HARE := hare PREFIX := /usr/local +HAREFLAGS := +LDFLAGS := + +ifdef DEBUG + HAREFLAGS += -lc + LDFLAGS += -fsanitize=address +endif $(EXE): - $(HARE) build -o $@ + LDFLAGS=$(LDFLAGS) $(HARE) build $(HAREFLAGS) -o $@ install: $(EXE) mkdir -p $(PREFIX)/bin/ @@ -16,6 +23,6 @@ clean: $(RM) $(EXE) check: - $(HARE) test + LDFLAGS=$(LDFLAGS) $(HARE) test $(HAREFLAGS) .PHONY: check clean install uninstall diff --git a/todo/open.ha b/todo/open.ha index 7692635..092ea24 100644 --- a/todo/open.ha +++ b/todo/open.ha @@ -16,6 +16,7 @@ export fn open(file: str) ([]str | fs::error) = { // read const todos = strings::fromutf8(todos)!; const todos = strings::split(todos, "\n")!; + defer free(todos); lib::slice_remove_empty(&todos); |
