path.c: refactor relative_path(), not only strip prefix