mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 01:54:24 +03:00
Fix reloading of the root directory.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
b136b2fa9f
commit
673d438938
@ -743,9 +743,12 @@ dir_list_reload (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
|
||||
/* Add ".." except to the root directory. The ".." entry
|
||||
(if any) must be the first in the list. */
|
||||
tmp_path = vfs_path_get_by_index (vpath, 0)->path;
|
||||
if (!
|
||||
(vfs_path_elements_count (vpath) == 1 && (tmp_path[0] == PATH_SEP)
|
||||
&& (tmp_path[1] == '\0')))
|
||||
if (vfs_path_elements_count (vpath) == 1 && tmp_path[0] == PATH_SEP && tmp_path[1] == '\0')
|
||||
{
|
||||
/* root directory */
|
||||
dir_list_clean (list);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!dir_list_init (list))
|
||||
{
|
||||
@ -765,6 +768,7 @@ dir_list_reload (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
|
||||
while ((dp = mc_readdir (dirp)) != NULL)
|
||||
{
|
||||
file_entry_t *fentry;
|
||||
|
||||
if (!handle_dirent (dp, fltr, &st, &link_to_dir, &stale_link))
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user