Skip to content
Snippets Groups Projects
Commit d213ae3b authored by Yorhel's avatar Yorhel
Browse files

Minor improvements to chdir on browsing

- Don't do the chdir when working on an imported file; To keep with the
  spirit that ncdu doesn't attempt to correlate the imported fs with the
  actual fs.
- Call path_chdir() instead of chdir(), the former can handle infinitely
  long paths. (And, more pragmatically, doesn't generate a warning with
  -Wunused-result enabled).

(That said, path_chdir() is fairly inefficient and could use some
improvements)
parent 20e1fbce
No related branches found
No related tags found
No related merge requests found
......@@ -191,7 +191,8 @@ void dirlist_open(struct dir *d) {
/* not necessary for any ncdu functionality,
* but enables screen/tmux to work out our cwd */
chdir(getpath(dirlist_par));
if(!dir_import_active)
path_chdir(getpath(dirlist_par));
/* set the head of the list */
head_real = head = d == NULL ? NULL : d->sub;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment