mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-28 04:35:09 +00:00
Don't resolve paths for files run from argv
Before this change, `fish ./test.fish` would fully resolve the relative paths and symlinks of test.fish, as reported by `status -f`. However `source` would not. With this change, both cases return relative paths. `realpath` may be used by scripts to resolve them. Fixes #2643
This commit is contained in:
parent
c5ed4e5cdf
commit
bc3260402a
1 changed files with 1 additions and 8 deletions
|
@ -573,15 +573,8 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
const wcstring rel_filename = str2wcstring(file);
|
const wcstring rel_filename = str2wcstring(file);
|
||||||
const wchar_t *abs_filename = wrealpath(rel_filename, NULL);
|
|
||||||
|
|
||||||
if (!abs_filename)
|
reader_push_current_filename(rel_filename.c_str());
|
||||||
{
|
|
||||||
abs_filename = wcsdup(rel_filename.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
reader_push_current_filename(intern(abs_filename));
|
|
||||||
free((void *)abs_filename);
|
|
||||||
|
|
||||||
res = reader_read(fd, empty_ios);
|
res = reader_read(fd, empty_ios);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue