Replace c function with cdpath