mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
possibly more reliable Bun.spawn (#1547)
* wip * wip * Fix bug with stdin * zig fmt * seems to work! * Update streams.test.js Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -1089,10 +1089,12 @@ pub fn toUTF8ListWithType(list_: std.ArrayList(u8), comptime Type: type, utf16:
|
||||
);
|
||||
}
|
||||
|
||||
try list.ensureTotalCapacityPrecise(utf16_remaining.len + list.items.len);
|
||||
const old_len = list.items.len;
|
||||
list.items.len += utf16_remaining.len;
|
||||
copyU16IntoU8(list.items[old_len..], Type, utf16_remaining);
|
||||
if (utf16_remaining.len > 0) {
|
||||
try list.ensureTotalCapacityPrecise(utf16_remaining.len + list.items.len);
|
||||
const old_len = list.items.len;
|
||||
list.items.len += utf16_remaining.len;
|
||||
copyU16IntoU8(list.items[old_len..], Type, utf16_remaining);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user