aboutsummaryrefslogtreecommitdiff
path: root/src/server/check.odin
diff options
context:
space:
mode:
authorDaniel Gavin <daga@foa.dk>2024-02-09 12:58:04 +0100
committerDaniel Gavin <daga@foa.dk>2024-02-09 12:58:04 +0100
commit3eb1e0e60a66a4fc7347fb77837ff45ccbe1cabb (patch)
treea45091f605d9e606337b0f294fc9b9f8fc0d6442 /src/server/check.odin
parent618c5db33d64410aa05feff3b9698171101c6a54 (diff)
Fix issues with check on multiple paths.
Diffstat (limited to 'src/server/check.odin')
-rw-r--r--src/server/check.odin10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server/check.odin b/src/server/check.odin
index b6d8e0e..73aef75 100644
--- a/src/server/check.odin
+++ b/src/server/check.odin
@@ -54,6 +54,8 @@ check :: proc(paths: []string, writer: ^Writer, config: ^common.Config) {
entry_point_opt :=
filepath.ext(path) == ".odin" ? "-file" : "-no-entry-point"
+ slice.zero(data)
+
if code, ok, buffer = common.run_executable(
fmt.tprintf(
"%v check %s %s %s %s %s",
@@ -117,7 +119,7 @@ check :: proc(paths: []string, writer: ^Writer, config: ^common.Config) {
}
}
- error.uri = string(buffer[source_pos:s.src_pos - 1])
+ error.uri = strings.clone(string(buffer[source_pos:s.src_pos - 1]), context.temp_allocator)
left_paren := scanner.scan(&s)
@@ -145,7 +147,7 @@ check :: proc(paths: []string, writer: ^Writer, config: ^common.Config) {
if seperator != ':' {
break scan_line
}
-
+
rhs_digit := scanner.scan(&s)
if rhs_digit != scanner.Int {
@@ -157,7 +159,7 @@ check :: proc(paths: []string, writer: ^Writer, config: ^common.Config) {
if !ok {
break scan_line
}
-
+
right_paren := scanner.scan(&s)
if right_paren != ')' {
@@ -178,7 +180,7 @@ check :: proc(paths: []string, writer: ^Writer, config: ^common.Config) {
continue
}
- error.message = string(buffer[source_pos:s.src_pos - 1])
+ error.message = strings.clone(string(buffer[source_pos:s.src_pos - 1]), context.temp_allocator)
error.column = column
error.line = line