| ... | @@ -1695,7 +1695,7 @@ const HashedFile = struct { | ... | @@ -1695,7 +1695,7 @@ const HashedFile = struct { |
| 1695 | fn stripRoot(fs_path: []const u8, root_dir: []const u8) []const u8 { | 1695 | fn stripRoot(fs_path: []const u8, root_dir: []const u8) []const u8 { |
| 1696 | if (root_dir.len == 0 or fs_path.len <= root_dir.len) return fs_path; | 1696 | if (root_dir.len == 0 or fs_path.len <= root_dir.len) return fs_path; |
| 1697 | | 1697 | |
| 1698 | if (std.mem.eql(u8, fs_path[0..root_dir.len], root_dir) and fs_path[root_dir.len] == fs.path.sep) { | 1698 | if (std.mem.eql(u8, fs_path[0..root_dir.len], root_dir) and fs.path.isSep(fs_path[root_dir.len])) { |
| 1699 | return fs_path[root_dir.len + 1 ..]; | 1699 | return fs_path[root_dir.len + 1 ..]; |
| 1700 | } | 1700 | } |
| 1701 | | 1701 | |
| ... | @@ -1810,8 +1810,8 @@ const FileHeader = struct { | ... | @@ -1810,8 +1810,8 @@ const FileHeader = struct { |
| 1810 | } | 1810 | } |
| 1811 | | 1811 | |
| 1812 | pub fn isExecutable(self: *FileHeader) bool { | 1812 | pub fn isExecutable(self: *FileHeader) bool { |
| 1813 | return std.mem.eql(u8, self.header[0..shebang.len], shebang) or | 1813 | return std.mem.eql(u8, self.header[0..@min(self.bytes_read, shebang.len)], shebang) or |
| 1814 | std.mem.eql(u8, self.header[0..elf_magic.len], elf_magic); | 1814 | std.mem.eql(u8, self.header[0..@min(self.bytes_read, elf_magic.len)], elf_magic); |
| 1815 | } | 1815 | } |
| 1816 | }; | 1816 | }; |
| 1817 | | 1817 | |