Do not realpath() everything since it is pointless and breaks symlinks.

GitHub issue 4427.
This commit is contained in:
nicm
2025-10-28 10:51:30 +00:00
parent 7cbb96528c
commit b4ba6e49af
2 changed files with 8 additions and 17 deletions

View File

@@ -136,16 +136,7 @@ cmd_source_file_done(struct client *c, const char *path, int error,
static void
cmd_source_file_add(struct cmd_source_file_data *cdata, const char *path)
{
char resolved[PATH_MAX];
if (realpath(path, resolved) == NULL) {
log_debug("%s: realpath(\"%s\") failed: %s", __func__,
path, strerror(errno));
} else
path = resolved;
log_debug("%s: %s", __func__, path);
cdata->files = xreallocarray(cdata->files, cdata->nfiles + 1,
sizeof *cdata->files);
cdata->files[cdata->nfiles++] = xstrdup(path);