version 1.32, 2015/11/10 22:29:33 |
version 1.33, 2015/11/10 22:33:47 |
|
|
file = xstrdup(path); |
file = xstrdup(path); |
else |
else |
xasprintf(&file, "%s/%s", cwd, path); |
xasprintf(&file, "%s/%s", cwd, path); |
if (realpath(file, resolved) == NULL) { |
if (realpath(file, resolved) == NULL && |
cmdq_error(cmdq, "%s: %s", file, strerror(errno)); |
strlcpy(resolved, file, sizeof resolved) >= sizeof resolved) { |
|
cmdq_error(cmdq, "%s: %s", file, strerror(ENAMETOOLONG)); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
f = fopen(resolved, flags); |
f = fopen(resolved, flags); |