Skip to main content

findcmd

Function findcmd 

Source
pub fn findcmd(arg0: &str, _docopy: i32, default_path: i32) -> Option<String>
Expand description

Port of char *findcmd(char *arg0, int docopy, int default_path) from Src/exec.c:897. Walk $PATH (or DEFAULT_PATH under default_path=1) for arg0, returning the matching path on success. _docopy is the C source’s “duplicate the result” flag — Rust ownership covers it without an explicit copy step. default_path=1 forces /bin:/usr/bin:... search (used by command -p).