* If path ends with suffix (complete path components), returns the * part before suffix (sans trailing directory separators). * Otherwise returns NULL. */
| 1322 | * Otherwise returns NULL. |
| 1323 | */ |
| 1324 | char *strip_path_suffix(const char *path, const char *suffix) |
| 1325 | { |
| 1326 | ssize_t offset = stripped_path_suffix_offset(path, suffix); |
| 1327 | |
| 1328 | return offset == -1 ? NULL : xstrndup(path, offset); |
| 1329 | } |
| 1330 | |
| 1331 | int daemon_avoid_alias(const char *p) |
| 1332 | { |