Thread (43 messages) 43 messages, 3 authors, 2025-11-03
STALE257d
Revisions (2)
  1. v4 current
  2. v5 [diff vs current]

[PATCH v4 06/29] interpret-trailers: buffer stdout output

From: Li Chen <hidden>
Date: 2025-10-14 12:26:16
Subsystem: the rest · Maintainer: Linus Torvalds

Simplified the non-in-place path in interpret_trailers
by writing the existing output strbuf directly to
stdout without creating a redundant temporary buffer.

Signed-off-by: Li Chen <redacted>
---
 builtin/interpret-trailers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
index 2c8b6fc3b9..cdf39dbca8 100644
--- a/builtin/interpret-trailers.c
+++ b/builtin/interpret-trailers.c
@@ -122,7 +122,7 @@ static void interpret_trailers(const struct process_trailer_options *opts,
 	if (opts->in_place)
 		write_file_buf(file, out_buf.buf, out_buf.len);
 	else
-		fwrite(out_buf.buf, 1, out_buf.len, stdout);
+		strbuf_write(&out_buf, stdout);
 
 	strbuf_release(&in_buf);
 	strbuf_release(&out_buf);
-- 
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help