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

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

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

Visibility: public

Requested revision: 6de152ec7cb906362b85ed86a8cf6a22b909b4df

Requested commit: 6de152ec7cb906362b85ed86a8cf6a22b909b4df

Commit: 6de152ec7cb906362b85ed86a8cf6a22b909b4df

Tree: 6d4c7795c90b07171700abbb4fe48a9f6411eed7

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

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

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