fix: crash in bun init by renaming string function to be more consistant (#7746)

This commit is contained in:
dave caruso
2023-12-20 13:44:53 -08:00
committed by GitHub
parent 00e745ec2c
commit 00955c712e
4 changed files with 48 additions and 5 deletions

View File

@@ -813,7 +813,7 @@ pub const RunCommand = struct {
if (!has_copied) {
bun.copy(u8, &path_buf, value.dir);
dir_slice = path_buf[0..value.dir.len];
if (!strings.endsWithChar(value.dir, std.fs.path.sep)) {
if (!strings.endsWithCharOrIsZeroLength(value.dir, std.fs.path.sep)) {
dir_slice = path_buf[0 .. value.dir.len + 1];
}
has_copied = true;