Set base_path_len to 0 if base_path is NULL. Also: Ternary operator, oh yeah!