std: fix off by one error in windows process creation

This commit is contained in:
daurnimator 2020-01-10 15:00:14 +11:00
parent ae324985a6
commit 6fb636050f
No known key found for this signature in database
GPG Key ID: 45B429A8F9D9D22A

View File

@ -636,7 +636,7 @@ pub const ChildProcess = struct {
retry: while (it.next()) |search_path| {
var ext_it = mem.tokenize(PATHEXT, ";");
while (ext_it.next()) |app_ext| {
const app_basename = try mem.concat(self.allocator, u8, &[_][]const u8{ app_name[0 .. app_name.len - 1], app_ext });
const app_basename = try mem.concat(self.allocator, u8, &[_][]const u8{ app_name, app_ext });
defer self.allocator.free(app_basename);
const joined_path = try fs.path.join(self.allocator, &[_][]const u8{ search_path, app_basename });