(reread_cmd): use vfs_path_cmp() to compare dirs.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-04-19 13:23:41 +04:00 committed by Slava Zanko
parent 1c05ebf8b9
commit bd4a696ab6
2 changed files with 6 additions and 13 deletions

View File

@ -1038,19 +1038,9 @@ reread_cmd (void)
{
panel_update_flags_t flag = UP_ONLY_CURRENT;
if (get_current_type () == view_listing && get_other_type () == view_listing)
{
char *c_cwd, *o_cwd;
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);
}
if (get_current_type () == view_listing && get_other_type () == view_listing &&
vfs_path_cmp (current_panel->cwd_vpath, other_panel->cwd_vpath) == 0)
flag = UP_OPTIMIZE;
update_panels (UP_RELOAD | flag, UP_KEEPSEL);
repaint_screen ();

View File

@ -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 next_free = 0;
struct stat st;
char *path;
/* ".." (if any) must be the first entry in the 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);
/* Do not add a ".." entry to the root directory */
path = vfs_path_to_str (vpath);
if ((path[0] == PATH_SEP) && (path[1] == '\0'))
next_free--;
g_free (path);
while ((dp = mc_readdir (dirp)) != NULL)
{