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:
ridiculousfish 2016-01-03 12:12:53 -08:00
parent c5ed4e5cdf
commit bc3260402a

View file

@ -573,15 +573,8 @@ int main(int argc, char **argv)
}
const wcstring rel_filename = str2wcstring(file);
const wchar_t *abs_filename = wrealpath(rel_filename, NULL);
if (!abs_filename)
{
abs_filename = wcsdup(rel_filename.c_str());
}
reader_push_current_filename(intern(abs_filename));
free((void *)abs_filename);
reader_push_current_filename(rel_filename.c_str());
res = reader_read(fd, empty_ios);