# std.os.execvpeZ_expandArg0: fix not restoring argv\[0\] · gitcafe/zig

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

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

Visibility: public

Requested revision: 0cd89e9176ab36fc5e267120dc4d75cb79d32684

Requested commit: 0cd89e9176ab36fc5e267120dc4d75cb79d32684

Commit: 0cd89e9176ab36fc5e267120dc4d75cb79d32684

Tree: c2109735be89fdaf86b55a95d98a4797d086217c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.os.execvpeZ_expandArg0: fix not restoring argv[0]

This function expands argv[0] into the absolute path resolved with PATH
environment variable before making the execve syscall. However, in case
the execve fails, e.g. with ENOENT, it did not restore argv to how it
was before it was passed in. This resulted in the caller performing an
invalid free.

This commit also adds verbose debug info when native system C compiler
detection fails. See #4521.

```

## Parents

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

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