| 98 | } |
| 99 | |
| 100 | char *reparent_relative_path(const char *old_cwd, |
| 101 | const char *new_cwd, |
| 102 | const char *path) |
| 103 | { |
| 104 | char *ret, *full; |
| 105 | |
| 106 | if (is_absolute_path(path)) |
| 107 | return xstrdup(path); |
| 108 | |
| 109 | full = xstrfmt("%s/%s", old_cwd, path); |
| 110 | ret = xstrdup(remove_leading_path(full, new_cwd)); |
| 111 | free(full); |
| 112 | |
| 113 | return ret; |
| 114 | } |
no test coverage detected