Skip to main content

cancd

Function cancd 

Source
pub fn cancd(s: &str) -> Option<String>
Expand description

Port of cancd() from Src/exec.c:6370 — C decl cancd(char *s).

Resolve a cd target against $cdpath and cd_able_vars. Returns the chosen absolute path (heap-dup) if cancd2 accepts it, else None.

C body uses CDPATH walking + cd_able_vars() fallback. Sets doprintdir = -1 when a non-trivial path is found (so cd echoes the resolved path).