nh2 / nh2/hatrace

procToArgv calls doesFileExist instead of checking for a slash

Open
#37 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Haskell
Stars
126
Forks
26
PR merge metrics
No merged PRs in 30d

Description

`execvp` work by checking for a slash in the path; if there is a slash, it assumes it is a path (absolute or relative), if there is no slash, it looks it up in PATH.

Therefore the current behaviour of `procToArgv` can be unexpected in that if you run `echo` while having a file called `echo` in current directory, it will run your file, while `execvp` will resolve it through PATH.

Open question: will `execv` accept a relative path? If it will, the fix is easy, if it will not, we’ll also have to resolve relative paths.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.