Skip to content

Do not use OS-specific execvpe() call, fixes #14

Val Packett requested to merge valpackett/pager-rs:env into master

The POSIX way to do this is to replace the environ pointer and do execvp(), but in this case the whole env reconstruction is pointless since the new env still contained literally everything from the current one. We can simply putenv() the relevant envs instead. Note that it is fine to give it whatever pointers since we will exec right from this stack frame, and the system will copy the env variables at exec time.

(Also, the previous "execve() on macos" workaround was broken, since it's the "p" that's the important variant here.)

Merge request reports