# std.zig.system: fix ELF file search · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/857c1d4ff2513dd29f10ef28a2bfbe61818dc1c4)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 857c1d4ff2513dd29f10ef28a2bfbe61818dc1c4

Requested commit: 857c1d4ff2513dd29f10ef28a2bfbe61818dc1c4

Commit: 857c1d4ff2513dd29f10ef28a2bfbe61818dc1c4

Tree: f832e87a0becbcad74afb2cb37aa5a4b68e969b6

Author: Eric Joldasov

Committer: Andrew Kelley

## Message

```
std.zig.system: fix ELF file search

 * Adjust buffer length a bit.
 * Fix detecting if file is a script. Logic below was unreachable,
 because 99% of scripts failed "At least 255 bytes long" check and were detected as ELF files.
 It should be "At least 4" instead (minimum value of "ELF magic length" and "smallest possible interpreter path length").
 * Fix parsing interpreter path, when text after shebang:
     1. does not have newline,
     2. has leading spaces and tabs,
     3. separates interpreter and arguments by tab or NUL.
 * Remove empty error set from `defaultAbiAndDynamicLinker`.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>

```

## Parents

- [7cf3167e989374d21280a29e29ed089bee9293fd](https://git.cafe/gitcafe/zig/commit/7cf3167e989374d21280a29e29ed089bee9293fd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/857c1d4ff2513dd29f10ef28a2bfbe61818dc1c4?format=markdown)
