mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 02:24:06 +00:00
If realpath() fails just try the original path.
This commit is contained in:
parent
005e462e01
commit
6f3475c6c7
2 changed files with 6 additions and 4 deletions
|
|
@ -81,8 +81,9 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||
file = xstrdup(path);
|
||||
else
|
||||
xasprintf(&file, "%s/%s", cwd, path);
|
||||
if (realpath(file, resolved) == NULL) {
|
||||
cmdq_error(cmdq, "%s: %s", file, strerror(errno));
|
||||
if (realpath(file, resolved) == NULL &&
|
||||
strlcpy(resolved, file, sizeof resolved) >= sizeof resolved) {
|
||||
cmdq_error(cmdq, "%s: %s", file, strerror(ENAMETOOLONG));
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
f = fopen(resolved, "rb");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue