Browse Source

reset n before stderr path too

Laytan Laats 10 months ago
parent
commit
c21e62ddb4
2 changed files with 2 additions and 0 deletions
  1. 1 0
      core/os/os2/process.odin
  2. 1 0
      tests/core/os/os2/process.odin

+ 1 - 0
core/os/os2/process.odin

@@ -426,6 +426,7 @@ process_exec :: proc(
 			}
 
 			if err == nil && !stderr_done {
+				n = 0
 				has_data, err = pipe_has_data(stderr_r)
 				if has_data {
 					n, err = read(stderr_r, buf[:])

+ 1 - 0
tests/core/os/os2/process.odin

@@ -21,4 +21,5 @@ test_process_exec :: proc(t: ^testing.T) {
 	testing.expect_value(t, state.success, true)
 	testing.expect_value(t, err, nil)
 	testing.expect_value(t, string(stdout), "hellope\n")
+	testing.expect_value(t, string(stderr), "")
 }