mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -09:00
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)
This commit is contained in:
parent
20e1fbce46
commit
d213ae3bb9
1 changed files with 2 additions and 1 deletions
|
|
@ -191,7 +191,8 @@ void dirlist_open(struct dir *d) {
|
||||||
|
|
||||||
/* not necessary for any ncdu functionality,
|
/* not necessary for any ncdu functionality,
|
||||||
* but enables screen/tmux to work out our cwd */
|
* 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 */
|
/* set the head of the list */
|
||||||
head_real = head = d == NULL ? NULL : d->sub;
|
head_real = head = d == NULL ? NULL : d->sub;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue