From c1ea489753489080c2b32cfb94c81169ab5f22b4 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 9 Jan 2016 11:07:45 +0000 Subject: [PATCH] Ticket #3412: info panel: rely on realpath for device info. When cd_symlinks is enabled cwd_vpath isn't pointed to real path. Hence device info may wrong. (Support for local filesystems only.) Signed-off-by: Andreas Mohr Signed-off-by: Andrew Borodin --- src/filemanager/info.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/filemanager/info.c b/src/filemanager/info.c index b7327ef46..11b724bcd 100644 --- a/src/filemanager/info.c +++ b/src/filemanager/info.c @@ -31,6 +31,7 @@ #include #include +#include #include #include /* PRIuMAX */ @@ -108,6 +109,8 @@ info_show_info (WInfo * info) static const char *file_label; GString *buff; struct stat st; + char rp_cwd[PATH_MAX]; + const char *p_rp_cwd; if (!is_idle ()) return; @@ -124,7 +127,12 @@ info_show_info (WInfo * info) if (get_current_type () != view_listing) return; - my_statfs (&myfs_stats, vfs_path_as_str (current_panel->cwd_vpath)); + /* don't rely on vpath CWD when cd_symlinks enabled */ + p_rp_cwd = mc_realpath (vfs_path_as_str (current_panel->cwd_vpath), rp_cwd); + if (p_rp_cwd == NULL) + p_rp_cwd = vfs_path_as_str (current_panel->cwd_vpath); + + my_statfs (&myfs_stats, p_rp_cwd); st = current_panel->dir.list[current_panel->selected].st; -- 2.11.4.GIT