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
|
/* Add ".." except to the root directory. The ".." entry
|
||||||
(if any) must be the first in the list. */
|
(if any) must be the first in the list. */
|
||||||
tmp_path = vfs_path_get_by_index (vpath, 0)->path;
|
tmp_path = vfs_path_get_by_index (vpath, 0)->path;
|
||||||
if (!
|
if (vfs_path_elements_count (vpath) == 1 && tmp_path[0] == PATH_SEP && tmp_path[1] == '\0')
|
||||||
(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))
|
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)
|
while ((dp = mc_readdir (dirp)) != NULL)
|
||||||
{
|
{
|
||||||
file_entry_t *fentry;
|
file_entry_t *fentry;
|
||||||
|
|
||||||
if (!handle_dirent (dp, fltr, &st, &link_to_dir, &stale_link))
|
if (!handle_dirent (dp, fltr, &st, &link_to_dir, &stale_link))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user