From b1bc205fe64d9b921ef4c3cccf0065d7e9909073 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sat, 9 Jan 2016 11:07:45 +0000
Subject: [PATCH] panelinfo: rely on realpath for device info
when cd_symlinks enabled cwd_vpath don't pointed to real path
hence device info may wrong
(support for local filesystems only)
Thanks Alain and Denis for reporting
fix it and resolve #3412
Signed-off-by: Andreas Mohr <and@gmx.li>
---
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 0824dbc..6587ca8 100644
a
|
b
|
|
31 | 31 | #include <config.h> |
32 | 32 | |
33 | 33 | #include <stdio.h> |
| 34 | #include <stdlib.h> /* realpath */ |
34 | 35 | #include <sys/stat.h> |
35 | 36 | #include <inttypes.h> /* PRIuMAX */ |
36 | 37 | |
… |
… |
info_show_info (WInfo * info) |
108 | 109 | static const char *file_label; |
109 | 110 | GString *buff; |
110 | 111 | struct stat st; |
| 112 | char rp_cwd[PATH_MAX]; |
| 113 | const char *p_rp_cwd; |
111 | 114 | |
112 | 115 | if (!is_idle ()) |
113 | 116 | return; |
… |
… |
info_show_info (WInfo * info) |
124 | 127 | if (get_current_type () != view_listing) |
125 | 128 | return; |
126 | 129 | |
127 | | my_statfs (&myfs_stats, vfs_path_as_str (current_panel->cwd_vpath)); |
| 130 | /* don't rely on vpath CWD when cd_symlinks enabled */ |
| 131 | p_rp_cwd = mc_realpath (vfs_path_as_str (current_panel->cwd_vpath), rp_cwd); |
| 132 | if (p_rp_cwd == NULL) |
| 133 | p_rp_cwd = vfs_path_as_str (current_panel->cwd_vpath); |
| 134 | |
| 135 | my_statfs (&myfs_stats, p_rp_cwd); |
128 | 136 | |
129 | 137 | st = current_panel->dir.list[current_panel->selected].st; |
130 | 138 | |