authorgravatar for tssund93@gmail.comTravis <tssund93@gmail.com> 2020-10-21 18:59:33-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-10-29 15:22:39-04:00
logf51ccf0d1f015c0f3bf8c9bebce65665e557c7de
treedf9235453856d25549e8ce4bd97ca5a7bbe999f3
parent26793453a7cf2016ae6fa7ad3d649dca150b53f5

panic when empty string passed as dest_rel_path to addInstallFileWithDir

causes the creation of a file instead of the directory that's meant to be created

1 files changed, 3 insertions(+), 0 deletions(-)

lib/std/build.zig+3
...@@ -907,6 +907,9 @@ pub const Builder = struct {...@@ -907,6 +907,9 @@ pub const Builder = struct {
907 install_dir: InstallDir,907 install_dir: InstallDir,
908 dest_rel_path: []const u8,908 dest_rel_path: []const u8,
909 ) *InstallFileStep {909 ) *InstallFileStep {
910 if (dest_rel_path.len == 0) {
911 panic("dest_rel_path must be non-empty", .{});
912 }
910 const install_step = self.allocator.create(InstallFileStep) catch unreachable;913 const install_step = self.allocator.create(InstallFileStep) catch unreachable;
911 install_step.* = InstallFileStep.init(self, src_path, install_dir, dest_rel_path);914 install_step.* = InstallFileStep.init(self, src_path, install_dir, dest_rel_path);
912 return install_step;915 return install_step;