mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 09:19:24 +03:00
(reread_cmd): use vfs_path_cmp() to compare dirs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
1c05ebf8b9
commit
bd4a696ab6
@ -1038,19 +1038,9 @@ reread_cmd (void)
|
|||||||
{
|
{
|
||||||
panel_update_flags_t flag = UP_ONLY_CURRENT;
|
panel_update_flags_t flag = UP_ONLY_CURRENT;
|
||||||
|
|
||||||
if (get_current_type () == view_listing && get_other_type () == view_listing)
|
if (get_current_type () == view_listing && get_other_type () == view_listing &&
|
||||||
{
|
vfs_path_cmp (current_panel->cwd_vpath, other_panel->cwd_vpath) == 0)
|
||||||
char *c_cwd, *o_cwd;
|
flag = UP_OPTIMIZE;
|
||||||
|
|
||||||
c_cwd = vfs_path_to_str (current_panel->cwd_vpath);
|
|
||||||
o_cwd = vfs_path_to_str (other_panel->cwd_vpath);
|
|
||||||
|
|
||||||
if (strcmp (c_cwd, o_cwd) == 0)
|
|
||||||
flag = UP_OPTIMIZE;
|
|
||||||
|
|
||||||
g_free (c_cwd);
|
|
||||||
g_free (o_cwd);
|
|
||||||
}
|
|
||||||
|
|
||||||
update_panels (UP_RELOAD | flag, UP_KEEPSEL);
|
update_panels (UP_RELOAD | flag, UP_KEEPSEL);
|
||||||
repaint_screen ();
|
repaint_screen ();
|
||||||
|
@ -541,6 +541,7 @@ do_load_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, gboolean
|
|||||||
int status, link_to_dir, stale_link;
|
int status, link_to_dir, stale_link;
|
||||||
int next_free = 0;
|
int next_free = 0;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
char *path;
|
||||||
|
|
||||||
/* ".." (if any) must be the first entry in the list */
|
/* ".." (if any) must be the first entry in the list */
|
||||||
if (!set_zero_dir (list))
|
if (!set_zero_dir (list))
|
||||||
@ -560,8 +561,10 @@ do_load_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, gboolean
|
|||||||
tree_store_start_check (vpath);
|
tree_store_start_check (vpath);
|
||||||
|
|
||||||
/* Do not add a ".." entry to the root directory */
|
/* Do not add a ".." entry to the root directory */
|
||||||
|
path = vfs_path_to_str (vpath);
|
||||||
if ((path[0] == PATH_SEP) && (path[1] == '\0'))
|
if ((path[0] == PATH_SEP) && (path[1] == '\0'))
|
||||||
next_free--;
|
next_free--;
|
||||||
|
g_free (path);
|
||||||
|
|
||||||
while ((dp = mc_readdir (dirp)) != NULL)
|
while ((dp = mc_readdir (dirp)) != NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user