mirror of
https://github.com/tmux/tmux.git
synced 2024-12-04 19:58:48 +00:00
Call realpath on the source file to match -f on the command line, GitHub
issue 4180.
This commit is contained in:
parent
2d8b6fcf23
commit
f8b56fdc3f
@ -122,6 +122,14 @@ cmd_source_file_done(struct client *c, const char *path, int error,
|
|||||||
static void
|
static void
|
||||||
cmd_source_file_add(struct cmd_source_file_data *cdata, const char *path)
|
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);
|
log_debug("%s: %s", __func__, path);
|
||||||
cdata->files = xreallocarray(cdata->files, cdata->nfiles + 1,
|
cdata->files = xreallocarray(cdata->files, cdata->nfiles + 1,
|
||||||
sizeof *cdata->files);
|
sizeof *cdata->files);
|
||||||
|
Loading…
Reference in New Issue
Block a user